Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- */
- if(this.status != "ON DUTY"){ // only process this when on duty.
- return;
- }
- needle.get(this.post_url,function(error,response){ // do the post here.
- if(error){
- return;
- }
- if(response.body.indexOf("COME") != -1){ // normal predefined location. what do we do?
- self.logger.info("normal come request - response.body='"+response.body+"'");
- return;
- }
- if(response.body.indexOf("!![") == -1){ // got the special gps cord
- try{
- var cop = response.body.split("COME");
- var lat = cop[1].split(",")[0].substr(4);
- var lng = cop[1].split(",")[1]
- lng = lng.substr(0,lng.length-1);
- self.directions.get_directions([self.lat,self.lng],[lat,lng], self.parse_directions(self,stuff));
- return;
- } catch(e){
- self.logger.error(e);
- return;
- }
- }
- self.logger.info("else - "+response.body);
- return;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement