Skip to content

Instantly share code, notes, and snippets.

@jdoxey
Created October 3, 2014 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdoxey/08174620af3a13ee3880 to your computer and use it in GitHub Desktop.
Save jdoxey/08174620af3a13ee3880 to your computer and use it in GitHub Desktop.
Pebble.addEventListener("ready", function(event) {
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200) {
var firstMin = request.response.match(/class="min">([0-9]+)</)[1];
Pebble.sendAppMessage({ 0: firstMin });
}
};
request.open("GET", "http://www.bom.gov.au/vic/forecasts/melbourne.shtml", true);
request.send();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment