Created
March 2, 2013 23:19
-
-
Save jmsalcido/5073714 to your computer and use it in GitHub Desktop.
Computo Movil Proyecto 1 - jmsalcido
This file contains 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
// Proyecto 1 de Computo Movil | |
// Script para el proyecto 1 de Computo Movil. | |
// Triggers the function when the screen unlocks | |
device.screen.on("unlock", function(){ | |
feeds.weather.get( | |
{location: 'Ciudad Obregon', | |
locationtype: 'city', | |
unittype: 'm' | |
}, | |
function onSucess(weather, textStatus, response) { | |
var temperatura = weather.now.temperature; | |
if(temperatura > 30) { | |
var msg = device.notifications.createMessageBox("Que Calor!!!"); | |
msg.content = "Wey, esta haciendo un chango de calor. Estamos a mas de 30 grados."; | |
msg.buttons = [":("]; | |
msg.show(); | |
} | |
console.log("Weather for " + weather.location + "is: " + weather.now.temperature); | |
}, | |
function onError(response, textStatus) { | |
console.error("Weather error from script"); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment