<?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' );class GCAlerter{public $gcCalendar;public $gcTimeCorrect;public function __construct($user, $pass, $tc){$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, "cl" );$ this ->gcCalendar = new Zend_Gdata_Calendar($client);$ this ->gcTimeCorrect = $tc;}public function Alert($text){$quickAddText = "$text " .date( "h:i" ,time() + $ this ->gcTimeCorrect);$ event = $ this ->gcCalendar->newEventEntry();$ event ->content = $ this ->gcCalendar->newContent($quickAddText);$ event ->quickAdd = $ this ->gcCalendar->newQuickAdd( 'true' );$newEvent = $ this ->gcCalendar->insertEvent($ event );return $newEvent->id->text;}}$user = "mycal@gmail.com" ;$pass = 'mypass' ;$timecorr = 2*60; // 2*60 = 2 min, 10*60 = 10min$gcAlerter = new GCAlerter($user, $pass, $timecorr);$gcAlerter->Alert( "OMG I`m die!!!" );?>* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/J45161/More articles:サバイバルキャンペーンレポート(エピソードIII)競合他社のサイトへのリンクを提供することは適切ですかサイトで競合他社を宣伝またはリンクすることは論理的ですか?カンファレンス「Platform 2009」ブログが主導権を握るGoogleが検索結果にWeb 2.0要素を導入NetBeans 6.5でCakePHPのオートコンプリートを設定します罰金を支払います。eBayでラップトップを購入した方法。音楽検索q00pAll Articles