Advertisement
Pyorot

LondonPogoMap/Pushbullet Bot GPS Tracker 1

Apr 21st, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. blob = '0';
  2. function gps() {
  3.     var xhr = new XMLHttpRequest;
  4.     xhr.open('GET', 'https://jsonblob.com/api/jsonBlob/'+blob, false);
  5.     xhr.onload = function() {
  6.         if (xhr.status == 200) {
  7.             try {var d = JSON.parse(xhr.response); home_lat = d[0]; home_lng = d[1];}
  8.             catch(error) {}
  9.         } else {console.log('Failed to get location')}
  10.     };
  11.     xhr.send();
  12. }
  13. var gpser = setInterval(gps, 60 * 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement