Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      */
  2.     if(this.status != "ON DUTY"){ // only process this when on duty.
  3.       return;
  4.     }
  5.     needle.get(this.post_url,function(error,response){ // do the post here.
  6.  
  7.         if(error){
  8.         return;
  9.     }
  10.  
  11.     if(response.body.indexOf("COME") != -1){ // normal predefined location. what do we do?
  12.         self.logger.info("normal come request - response.body='"+response.body+"'");
  13.             return;
  14.     }
  15.  
  16.     if(response.body.indexOf("!![") == -1){ // got the special gps cord
  17.         try{
  18.             var cop = response.body.split("COME");
  19.             var lat = cop[1].split(",")[0].substr(4);
  20.             var lng = cop[1].split(",")[1]
  21.             lng = lng.substr(0,lng.length-1);
  22.             self.directions.get_directions([self.lat,self.lng],[lat,lng], self.parse_directions(self,stuff));
  23.             return;
  24.  
  25.         } catch(e){
  26.             self.logger.error(e);
  27.             return;
  28.         }  
  29.     }
  30.     self.logger.info("else - "+response.body);
  31.     return;
  32.    });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement