Skip to content

Instantly share code, notes, and snippets.

@gusdleon
Last active July 23, 2020 04:57
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 gusdleon/0e43fa883542cf59c993ac4659aa6a0e to your computer and use it in GitHub Desktop.
Save gusdleon/0e43fa883542cf59c993ac4659aa6a0e to your computer and use it in GitHub Desktop.
/*
by Gustavo de León @gusdleon
This code is in the public domain.
*/
var Texto = Twitter.newTweetByUser.Text; //Guardando el contenido del Tweet
var mag = 6.0; //Magnitud minima de sismo que activará la notificacion
while(mag >= 1 && mag <= 11 ){
if(Texto.indexOf(("Magnitud "+ mag) ) >=0 ){
mag = parseFloat((mag + 0.1).toFixed(1));
break;
}else{
if(mag >=10){
IfNotifications.sendNotification.skip();
break;
}
mag = parseFloat((mag + 0.1).toFixed(1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment