Google Contacts/Calendar API for JavaScript ãããã¯ãã¼ã¯ã¬ããããå¼ã³åºã
Google GData API ã«ã¯ PHP, Python, Java ãªã©ã¨ãã£ããµã¼ããµã¤ãè¨èªã®ä»ã« JavaScript ã®å®è£ ããããããã使ãã¨ãWebãã©ã¦ã¶ããç´æ¥Googleã®ãµã¼ãã«ä¿ç®¡ããããã¼ã¿ã«ã¢ã¯ã»ã¹ã§ããã
ãããåãªãJSONPã§ã®ãã£ã¼ãé ä¿¡ï¼ãããªãã¯ã«å ¬éããããã¼ã¿ã®ã¿ï¼ãªã©ã¨ããããã§ã¯ãªããGoogle Account Authã¨é£åãã¦ãGoogleãã¼ã¿ã¹ãã¬ã¼ã¸ã«å¯¾ãã¦èªã¿/æ¸ããã§ããããã«ãªã£ã¦ããããµã¼ãä¸ã«ãããã·ããã°ã©ã ã¯å¿ è¦ãªããã»ãã·ã§ã³ãã¼ã¯ã³ã®ããåãã¾ã§å«ãããã¹ã¦Client JavaScriptã®ã¿ã§å®çµããã
ãã¦ããã£ããããã¾ã§ã§ãã¦ãããªããã©ãããªãããã¯ãã¼ã¯ã¬ããããå¼ã¹ãªããã¨æã£ããããã¦èª¿ã¹ã¦å®è£ ãã¦ã¿ãã
çµè«ããè¨ãã¨ãå¯è½ã
å®è£ ãã¦ã¿ãããã¯ãã¼ã¯ã¬ããã®ä¾ï¼
Google Contact API
ã½ã¼ã¹ã³ã¼ãï¼
http://stomita.sakura.ne.jp/lab/gdata_bookmarklets/gcontacts.js
Google Calendar API
ã½ã¼ã¹ã³ã¼ãï¼
http://stomita.sakura.ne.jp/lab/gdata_bookmarklets/gcal.js
å¼ã³åºãç¨ããã¯ãã¼ã¯ã¬ãã
ã½ã¼ã¹ã³ã¼ãï¼
http://stomita.sakura.ne.jp/lab/gdata_bookmarklets/gdata-bookmarklet.js
ã«ã¹ã¿ã ã§ä½æããã«ã¯ããã®ã¹ã¯ãªããã§å®ç¾©ããã¦ãã waitGdataReady ã¡ã½ããã®ç¬¬ä¸å¼æ°ã«ã¹ã³ã¼ãURL*1ãæå®ãã¦ãã³ã¼ã«ããã¯é¢æ°ã«å®éã®å¦çã渡ãã¦ããã°ãããã³ã¼ã«ããã¯ããã¦ããã¨ãã«ã¯ããã§ã«åã¹ã³ã¼ãã¸ã®ã¢ã¯ã»ã¹è¨±å¯ãä¸ããããç¶æ
ã«ãªã£ã¦ããã
解説
ããã¯ãã¼ã¯ã¬ããã§å¼ã³åºãã«ããã£ã¦ãããã¤ã注æããç¹ããã£ãã
ã¾ããDeveloper Guideã«ããé常ã®ã¹ã¯ãªããèªã¿è¾¼ã¿ã®æ¹æ³ã¯ãããã¥ã¡ã³ããã¼ãå®äºåã«ã¹ã¯ãªããããã¼ãããããã¨ãåæã«ãã¦ãããããã®ã¾ã¾ã§ã¯ä½¿ããªãã
ããã¯ãã¼ã¯ã¬ããããgoogleã¹ã¯ãªããããã¼ãããããã«ã¯ãã³ã¼ã«ããã¯é¢æ°ãã¹ã¯ãªããã«æå®ããã¨ããæ¹æ³ã§è¡ãããã®æ¹æ³ã¯å
¬å¼ããã¥ã¡ã³ãã«ã¯è¦å½ããããããããã©ããã®ã¡ã¼ãªã³ã°ãªã¹ããªã©ã«ã§ã¦ããã®ãããããªãããèªåã¯ä»¥ä¸ã®è¨äºãããã®æ¹æ³ãç¥ã£ãã
Big Sky :: Google Visualizationを動的にロードしてGreasemonkey等で使用されているSITEINFOをGoogle SpreadSheetから取得する
function jsapi_loaded() { google.load("visualization", "1", {"callback" : querySITEINFO}); } function loadExampleSITEINFO() { var s = document.createElement('script'); s.charset = 'utf-8'; s.src = 'http://www.google.com/jsapi?callback=jsapi_loaded'; document.body.appendChild(s); }
ã¾ããGoogle Account Auth ãå é¨çã«çµ¡ãã§ããã®ã§ããã¼ã¯ã³ã®ããåãã®ããã«ãªãã¤ã¬ã¯ããçºçãã¦ãã¾ãããã®ãããã³ã³ããã¹ãã失ãããªãããã«ãå¥ã¦ã£ã³ãã¦ã«ããå¿ è¦ããã£ãã
ããã¯IFRAMEã§ãã£ã¦ãã§ãããããããªããããã£ãã·ã³ã°ã®æ¸å¿µããã¢ãã¬ã¹ããããããã«ãã¹ãã¨èãããããã¢ããã¦ã£ã³ãã¦ã«ããããã®ããããã¯ãã¼ã¯ã¬ãããå¼ã³åºããµã¤ãã«ããã¦ãããã¢ãããããã¯ã¯ç¡å¹ã«ãã¦ããå¿ è¦ãããã
ã¾ããGoogle ããã®ãã¼ã¯ã³ã¯ãã¨ãã¨ã®ãã¼ã¸ã®URLã«ãªãã¤ã¬ã¯ãããã¦å¸°ã£ã¦ããããã«ãªã£ã¦ãããããã¦ãã®ãã¼ã¸ã«ã¯ãã¡ããgoogleã¹ã¯ãªããã¯å ¥ã£ã¦ããªãï¼ï¼ãã°ã¤ã³å¦çãç¶ããããªãï¼ãããã§ã親ã¦ã£ã³ãã¦å´ã®ã¹ã¯ãªããã§ãããã¢ããã¦ã£ã³ãã¦ãç£è¦ãããã¼ã¯ã³ãæ»ã£ã¦ããã¨ãã«ã¯åçã«googleã¹ã¯ãªããããã¼ãããããã«è£å©ãã¦ããã
ãã®ä»ããã©ã¦ã¶æ¯ã«æåã«éãããã£ããããå ´å½ããçãªä¿®æ£ãå ¥ããããã¹ã¦ã®å ´åã«å¯¾å¿ã§ãããèªä¿¡ãç¡ãããæå ã®ç°å¢ã§ã¯ãªãã¨ãåãã¦ããï¼Firefox3, IE7, Safari3)ã
å¿ç¨ä¾
Contacts APIã§ã¯ èªåã®Gmailã®ã³ã³ã¿ã¯ããªã¹ãã«å¯¾ãã¦ã¯ã¨ãªãæãããã¨ãã§ããã®ã§ãä»»æã®ããã¹ãããã¯ã¹ã«å¯¾ãã¦ã¢ãã¬ã¹è£å®æ©è½ãåæã«è¿½å ãã¿ãããªãã¨ãã§ãããã
注æäºé
ãã¼ã¸ã®ã¨ã³ã³ã¼ãã£ã³ã°ã«ãã£ã¦æååããoråå¾ã«å¤±æãããããããUTF-8ãªãã¼ã¸ãªã大ä¸å¤«ã ãã©ãããã¯ãã¼ã¯ã¬ããã¨ãã¦å¼ã³åºã以ä¸ã§ããã ããã¹ã¦ã®ãã¼ã¸ã§ä½¿ãããã®ã ããä»ã®æç¹ã§ã¯ããããããªã
ãã¨ãGoogleã®JavaScript AuthSubã¯ã次å以éã«ãã¼ã¯ã³ã®ããåããããªãã¦ãããããã«ãå¼ã³åºãããã¼ã¸å ã§æå¹ãªcookieã®ä¸ã«ã»ãã·ã§ã³ãã¼ã¯ã³ãä¿åãããããã¯é常ã®å ´åã¯æ§ããªããããããªãï¼ãã¨ãã¨ãã®ãµã¼ãã¹ã®æä¾è ã§ããããï¼ããããã¯ãã¼ã¯ã¬ããã¨ãã¦å¼ã³åºããå ´åã¯ãã»ãã·ã§ã³ãã¼ã¯ã³ã®ä¿æè ã¯å®è³ªçã«ã¯ã¦ã¼ã¶èªèº«ã§ããã¯ããªã®ã§ããªãã¹ããµã¼ãã«ã¯ä¼ãã¦ã»ãããªãã¯ãã ããã®ãããå¦çãçµãã£ãããã°ã¢ã¦ãã¡ã½ãããå¼ã³åºãã¦ç¡å¹ã«ãã¦ããã®ãããããæã¾ããã
ä»ã®ãµã¼ãã¹ã¯ï¼
Google GData APIåæ§ã«ãWebãã©ã¦ã¶ããç´æ¥èªã¿æ¸ãã§ãããµã¼ãã¹ã¨ãã¦ã¯ãAOL WebAIMãFacebook ã®JavaScript APIããããè¦ãã¨ãããAOL WebAIMã¯ãªãã¤ã¬ã¯ãå ãç»é²å¶ã«ãã¦ããã®ã§ãããã使ããªããFacebook ã®æ¹ã Developerãã¼ããµã¤ãURLã«ã²ãã¥ãã¦ãããªãã°ã ãã ããããããWebãµã¼ãã¹ã³ã³ã·ã¥ã¼ãå´ã®è¦ä»¶ã¨ãã¦ãã¯ãã¹ãã¡ã¤ã³éä¿¡ãéæããããã®IFRAMEãããã·HTMLãåä¸ãã¡ã¤ã³ã®ãµã¼ãã«ç½®ãããã«ä¿ãã¦ãããããã¦ã¼ã¶ããåæã«ä½¿ãã¨ãããã¨ã¯ã§ãããã«ãªãã
ãã¡ãããã©ã¦ã¶ããã¯ã¿åºãã¦ã°ãªã¢ã³ããGearsããAIRããããã°ã§ããã ãããã©ãããã«ãã£ã¡ãã£ããããããããªãããããã¨ãã主æ¨ã§æ¸ãã¦ããã®ã¯ãç解ããã ãã¦ãããã¨æãã¾ãã
ææ³
èªåã®ãã¼ã¿ã®ä½¿ãæ¹ã¯ããã¼ã¿ãé ãã£ã¦ãããµã¼ãã¹ãããã¤ãã§ããªãããã®ãµã¼ãã¹ãããã¤ãã¨é£æºãã¦ãããµã¤ãã®éçºè ã§ããªããèªåã決ãããããã¯ä¸ç¨®ã® User Centric Web Service, ããã㯠Data Portability ã®å§¿ãªãã ã¨ããããã§ãããã©ãã§ããããã
*1:Contacts APIãªãhttp://www.google.com/m8/feeds, Calendar APIãªãhttp://www.google.com/calendar/feeds