Alarmas Sms (gracias a google)
Hola el otro dia vi en el blog de Ivan L?pez como usaba las alarmas del google calendar, para enviarse SMS al m?vil con ‘alertas’, y as? poder tener controlado sus servidores.
El ‘problema’, es que esta en java, as? que decid? hacer lo mismo pero en php, para que mas gente pudiese usarlo.
El modo de empleo es el mismo, necesitas PHP 5.1.4 o superior (son las necesarias para usar la API) y las librer?as ZEND de Gdata.
Para mas informaci?n del uso de la API se puede mirar directamente a la web de google code.
/* ** Generador de alertas sms a traves de google ** Basado en el de Ivan Lopez (lopezivan.blogspot.com) ** Elias Badenes, 2007 ** elias (at) badenes (dot) es */ require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_AuthSub'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Calendar'); function crearAlerta($cliente, $texto) { $dia? = date('Y-m-d'); $hIni = date('H:i', strtotime('now +6 minutes')); $hFin = date('H:i', strtotime('now +7 minute')); $gdataCal = new Zend_Gdata_Calendar($cliente); $evento?? = $gdataCal->newEventEntry(); $startDate = $dia; $endDate?? = $dia; $tzOffset? = '+02'; //en verano '+02' en invierno '+01' $startTime = $hIni; $endTime?? = $hFin; //asigno el texto $evento->title = $gdataCal->newTitle($texto); //Asigno el tiempo $cuando = $gdataCal->newWhen(); $cuando->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00"; $cuando->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00"; //alerta sms $metodo = 'sms'; //alert, email o sms $alerta = $gdataCal->newReminder(); $alerta->setMinutes(5); $alerta->setMethod('sms'); $cuando->setReminders(array($alerta)); $evento->when = array($cuando); echo 'Insertando Alerta: '.$texto."n"; $a = $gdataCal->insertEvent($evento); } if(count($argv) < 4) { echo "Uso: $argv[0] <usuario> <password> <texto>n"; die(); } $usuario? = $argv[1]; $password = $argv[2]; $texto??? = ''; $argc???? = count($argv); for( $i=3; $i>$argc; $i++) { $texto .= $argv[$i].' '; } $servicio = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; $cliente? = Zend_Gdata_ClientLogin::getHttpClient($usuario, $password, $servicio); crearAlerta($cliente, trim($texto));
Espero que lo disfruteis.
88 Comments
famciclovir over the counter – buy generic famciclovir over the counter brand valaciclovir
digoxin 250mg pill – trandate 100 mg generic how to get lasix without a prescription
order microzide 25 mg without prescription – norvasc usa bisoprolol 10mg pill
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
very informative articles or reviews at this time.
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
There is definately a lot to find out about this subject. I like all the points you made
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
crestor pills willow – caduet wake caduet online monkey
zocor merry – fenofibrate gift lipitor claw
viagra professional counter – avana blame levitra oral jelly online shirt
priligy specter – levitra with dapoxetine steward cialis with dapoxetine onto
cenforce feeling – cenforce hear brand viagra online grumble
brand cialis careful – penisole yeah penisole moan
cialis soft tabs online detect – cialis super active online thorough1 viagra oral jelly online star
brand cialis look – alprostadil crumble penisole stout
I like the efforts you have put in this, regards for all the great content.
I like the efforts you have put in this, regards for all the great content.
This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
Awesome! Its genuinely remarkable post, I have got much clear idea regarding from this post
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
cialis soft tabs wrap – viagra super active online lose viagra oral jelly flicker
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
Good post! We will be linking to this particularly great post on our site. Keep up the great writing
Nice post. I learn something totally new and challenging on websites
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
cenforce gratitude – kamagra pills waiter brand viagra online resolution
acne medication twice – acne medication fetch acne medication pierce
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
There is definately a lot to find out about this subject. I like all the points you made
I appreciate you sharing this blog post. Thanks Again. Cool.
inhalers for asthma axe – asthma treatment mere inhalers for asthma nail