Created
February 26, 2014 06:09
-
-
Save neuman/9224425 to your computer and use it in GitHub Desktop.
Shower Time Tasker JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
showScene('Tester'); | |
mediaVol(15); | |
say("Good morning Eric, welcome to "+global('DAYW')+". Let me check the weather."); | |
//getLocation( 'net' ); | |
//var coords = global('LOCN').split(","); | |
var http = new XMLHttpRequest(); | |
//flashLong('http://api.openweathermap.org/data/2.5/find?lat='+coords[0]+'&lon='+coords[1]+'&units=imperial&mode=json'); | |
//http.open("GET",'http://api.openweathermap.org/data/2.5/find?lat='+coords[0]+'&lon='+coords[1]+'&units=imperial&mode=json&type=like',false); | |
http.open("GET",'http://api.openweathermap.org/data/2.5/find?q=brooklyn&units=imperial&mode=json&type=like',false); | |
http.send(); | |
var json = http.responseText; | |
var weather = JSON.parse(json); | |
var city = weather.list[0]; | |
say(city.weather[0].description+" and "+Math.round(city.main.temp)+" degrees now in "+city.name+"."); | |
say("Enjoy your shower! I'll let you know when it's been ten minutes.") | |
loadApp("Spotify"); | |
wait(5000); | |
performTask('playspotify'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment