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.
19 Comments
Doctors rarely probe into the full set of psychiatric and physical symptoms of their patients which could indicate TBD buy finasteride
Your blog post had me hooked from the first sentence.
atorvastatin 20mg over the counter order atorvastatin 40mg buy cheap generic lipitor
cipro 1000mg cost – buy keflex 500mg buy amoxiclav sale
buy cipro pills for sale – buy generic myambutol for sale how to get augmentin without a prescription
purchase flagyl generic – how to buy amoxicillin azithromycin 500mg oral
ciplox 500 mg for sale – brand erythromycin 500mg erythromycin canada
order generic valacyclovir – buy valacyclovir online cheap acyclovir generic
buy ivermectin stromectol – purchase suprax for sale buy sumycin 250mg pill
metronidazole over the counter – order cefaclor 250mg online buy zithromax 500mg sale
Wow, wonderful weblog layout! How long have
you been blogging for? you make blogging glance easy.
The total glance of your site is great, as smartly as the
content material! You can see similar here e-commerce
Have you ever thought about including a
little bit more than just your articles? I mean, what you say is
fundamental and everything. Nevertheless think of if you added some great visuals or videos to give your posts more, «pop»!
Your content is excellent but with images and clips, this blog could definitely be one
of the very best in its niche. Wonderful blog! I saw similar here: Najlepszy sklep
purchase ampicillin sale buy generic ampicillin purchase amoxil
furosemide ca – buy captopril without prescription order capoten for sale
Hi there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying
to get my blog to rank for some targeted keywords but I’m not seeing very good success.
If you know of any please share. Cheers!
You can read similar text here: Najlepszy sklep
It’s very interesting! If you need help, look here: ARA Agency
metformin 1000mg cost – order glucophage 1000mg pill buy lincocin pills for sale
retrovir drug – order glycomet 500mg order zyloprim 100mg online cheap
how to buy clozaril – oral ramipril purchase famotidine online cheap