SHARE
TWEET

Untitled

a guest Jul 16th, 2013 124 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var apiID = "99af**************9bb8";
  2. var phone = "89***********01";
  3. var num = [
  4.   ["RB**********CN", "21************************fe6"],
  5.   ["RT**********HK", "e9************************3cd"]
  6. ];
  7.  
  8. function sendSMS(text){
  9.   UrlFetchApp.fetch("http://sms.ru/sms/send?api_id="+apiID+"&to="+phone+"&text="+encodeURI(text));
  10. }
  11.  
  12. function checkStatus(){
  13.  
  14.   for(i=0; i<num.length; i++){
  15.     var response = UrlFetchApp.fetch("http://s1.17track.net/Rest/HandlerTrackPost.ashx?lo=www.17track.net&num="+num[i][0]+"&hs="+num[i][1]);
  16.     var result = response.getContentText().match(/z":.*a":"(.*)".*b":"(.*)"}/i);
  17.     if(UserProperties.getProperty(num[i][0]) != result[1]){
  18.       var sendstring = num[i][0]+": "+result[2];
  19.       sendSMS(sendstring);
  20.       UserProperties.setProperty(num[i][0], result[1]);
  21.     }
  22.   }
  23.  
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top