Skip to content

Instantly share code, notes, and snippets.

@etozzato
Last active June 23, 2016 14:11
Show Gist options
  • Save etozzato/1935581b612a00933aee9bc13ddf9474 to your computer and use it in GitHub Desktop.
Save etozzato/1935581b612a00933aee9bc13ddf9474 to your computer and use it in GitHub Desktop.
simpy ex
navigator.geolocation.getCurrentPosition(function(pos) {
var coords = pos.coords;
var weatherUrl = 'http://api.openweathermap.org/data/2.5/weather?' +
'lat=' + coords.latitude + '&lon=' + coords.longitude + '&units=metric';
ajax({ url: weatherUrl, type: 'json' }, function(data) {
simply.text({ title: data.name, subtitle: data.main.temp });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment