AOL WebAIM APIã注ç®ãã¹ãï¼ã¤ã®çç±
AOL OpenAuthがすごいã¨ããJSONPã«ããèªè¨¼ã ã¨ãé¨ãã§ããã©ããã去年の11月にAOL Web AIM APIが公開されていたã¨ãããã¨ã«ã¤ãã¦ããªãã§æ°ã¥ãã¦ãªãã£ãã®ããä¸å¹´è¿ãããããæ£å½ã«è©ä¾¡ãã¦ããªãã£ããã¨ã¯ãæ¥ãã¹ããã¨ã ã
Web AIM APIã¯ã以ä¸ã®çç±ã§ç»æçããããã¯ã¡ãã£ã¨ãã¬ãã£ããªå´ããè¦ãã°åé¡å ãªAPIã§ãããããã¦ãããããWebãµã¼ãã¹APIãè¨è¨ï¼éçºãã人ãããã³Webã®ã»ãã¥ãªãã£ãèãã人ã«ã¨ã£ã¦ã¯ãå°ãªãã¨ãç¾å¨ãããã£ãWebãµã¼ãã¹ã®å®è£ ãåå¨ãã¦ãããã¨ã«ã¤ãã¦ã¯ãã¡ããã¨æ³¨è¦ãã¦ãããªããã°ãªããªãã
1. ãµã¼ãã¬ã¹ã§ã¡ãã»ã³ã¸ã£ã¼ã¢ããªãæ§ç¯ã§ãã
ãããã¨ãããä¸çªç®ã«éè¦ãªãã¤ã³ããããã¯APIãªã¯ã¨ã¹ãã¨ãã¦JSONPå½¢å¼ã®ãã¤ã³ãã£ã³ã°(éæ¬æ¹æ³)ãæ¡ç¨ãã¦ãããã¨ã«ããããµã¼ãã¬ã¹ã§ã¢ããªãä½ãããã¨ã®ã¡ãªããã¯ããã¦ã¯è§¦ããªãããå°ãªãã¨ãç¾å¨ã数多くのWebサービスAPIがJSONPインターフェースを採用しているã®ã¯ãã®ã¡ãªãããæãã¦ãããããã ãããã¡ãªã¿ã«JSONP以å¤ã®é常ã®ã¡ãã»ã¼ã¸ãã¤ã³ãã£ã³ã°ãããã®ã§ãPHPããRubyããã§ãµã¼ãã¢ããªãæ¸ããã¨ããã¡ããã§ããã¯ãããã ãä»ã®APIã¨æ¯ã¹ã¦å¥æ®µããã«é¢ç½ã¿ã¯ãªãã®ã§ãä»åã¯ããã«ã¯è§¦ããªãã
2. AOL OpenAuth ã使ã£ãå®è£ ã§ãã
AOL OpenAuthã®ä»æ§ã®ã¨ãã»ã³ããªãã¯ãã«ã¤ãã¦ã¯既に書いたããã ãä»ã¨ãªã£ã¦ã¯ãããã¯ã»ã¼å è¡ãã¦å ¬éãããWeb AIMã®ä»æ§ã«èµ·å ãã¦ããã¨èãã¦ãããã¨æããOpenAuthã®ç¹å¾´ã«ã¤ãã¦ç«¯çã«è¨ãã¨ãPure JavaScriptã®ã¯ã©ã¤ã¢ã³ãã§ãµã¼ãã¬ã¹ã§åæ£èªè¨¼ï¼æ£ç¢ºã«ã¯å人æ å ±ã®ã¯ã¬ã¼ã ã«ãªãã¨æããã©ï¼ãã§ãããã¨ãããã®ã§ãããããããã¡ããä»ã®åæ£èªè¨¼APIã¨åæ§ã«ãµã¼ãããã°ã©ã ãã使ãæ¹æ³ãããã ãããã©ãåæ§ã«ããã»ã©é¢ç½ã¿ããªãã®ã§ãããã§ã¯è§¦ããªãã
3. JSONPã§ãã©ã¤ãã¼ããã¼ã¿ãé ä¿¡ãã¦ãã
AIM ã¯ã¤ã³ã¹ã¿ã³ãã¡ãã»ã¼ã¸ã³ã°ãµã¼ãã¹ã§ãããããã¦ã¼ã¶ãäºãã«ã¡ãã»ã¼ã¸ãéã対象ã®IDï¼ã¹ã¯ãªã¼ã³ãã¼ã ï¼ã®ãªã¹ããåéãªã¹ãã¨ããå½¢ã§ãµã¼ãã«ä¿åãã¦ããããã®æ å ±ã¯ãã¡ããä¸è¬ã«å ¬éãããæ å ±ã§ã¯ãªãããã©ã¤ãã¼ããªãã®ã§ããã
誰ã§ãã¢ã¯ã»ã¹å¯è½ãªãããªãã¯ãªæ å ±ã¨éã£ã¦ããã©ã¤ãã¼ããªæ å ±ã«ã¢ã¯ã»ã¹ããããã«ã¯ãã¾ãæ å ±ã¸ã®ã¢ã¯ã»ã¹ãè¦æ±ãã¦ãã主ä½ã誰ã§ãããã示ããªãã¨ãããªãããã®ããã«ã2. ã§ãããèªè¨¼APIããããã¨ãåæã«ãªãã
ããã¦ãä½ãããã®å¤é¨ãµã¼ãã¹ããã©ã¤ãã¼ãæ å ±ã¸ã®ã¢ã¯ã»ã¹è¦æ±ãã代çã§è¡ãããããªå ´åããã®ã代ç人ãããã©ã¤ãã¼ããã¼ã¿ãæ±ã£ã¦ãããã©ãããã¦ã¼ã¶ã«å¯¾ãã¦åæãæ±ãããã¨ããããã»ã¹ãè¨ããã®ãä¸è¬çã§ããããã®ãããã¯ãGoogle CalendarãFlickr ãªã©ã¸ã®3rd Party Webã¢ããªããã®APIã¢ã¯ã»ã¹ã«ããã¦ããã¦ã¼ã¶ã®ãã©ã¤ãã¼ããªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ããã¨ãã«ã¯ç»é¢é·ç§»ã®éã«åæç»é¢ãç¨æããã¦ããã®ã§ãããããããã馴æã¿ãããããªãããã ãããã¨éãã®ã¯ãGoogleãFlickrããµã¼ãããã°ã©ã ã®å©ç¨ãåæãªã®ã«å¯¾ããå ã«ã説æããéã Web AIMã«ã¯JSONPãã¤ã³ãã£ã³ã°ããããWebã¢ããªã§ãããªãããã¹ã¦ãµã¼ãã¬ã¹ã§åãããã
4. JSONPãåç §ã®ã¿ã§ãªãæ´æ°ç³»ãªã¯ã¨ã¹ãã«ãå©ç¨ãã¦ãã
ãã©ã¤ãã¼ããªã½ã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ãåºæ¥ãã®ãªããå¿ ç¶çã«æ´æ°ã«ã¤ãã¦ãåºæ¥ãããã«ãªããæ´æ°ã¨ãã£ã¦ãIMã®éä¿¡ã ãã©ãç¶æ å¤åãã¨ããªããããªJSONPã£ã¦ã®ã¯ãå°ãªãã¨ãèªåã¯ããã¨ã¯ã¦ãªã¹ã¿ã¼ä»¥å¤ã«ç¥ããªããã¯ã¦ãªã¹ã¿ã¼ã¯ç¨éãéãããããåæãªæ¸ãè¾¼ã¿ãªã¯ã¨ã¹ããèµ·ãã£ã¦ãããã»ã©è¢«å®³ã¯ãªãã ãããã©ãIMã¡ãã»ã¼ã¸ãWebã¢ããªã«ãã£ã¦åæã«éä¿¡ããããçµæ§å°ãããªã®ã§ã3. ã§è¿°ã¹ãåæã®ã·ã¹ãã ãéè¦ã«ãªã£ã¦ããã
5. IMã®ã¤ãã³ãã®é ä¿¡ã«JSONP Cometãã¤ãã£ã¦ãã
AIMã¯IMã ãããµã¼ãããã¤ãã³ãã®éç¥ãåºæ¥ãªãã¨APIã¨ãã¦ã¯å®å ¨ã§ã¯ããã¾ãããããã¯ãCometã使ã£ã¦ã¤ãã³ãå¾ ã¡ã®URLã«ã³ãã¯ã·ã§ã³ãå¼µã£ã¦ãããã¨ã«ãã£ã¦å®ç¾ãã¦ããã
JSONPã§Cometã¨ããã®ã¯ããããã大åã®äººã¯Lingrãæãã¤ãã ãããã©ãLingrã®CometãJSONPã ã£ãã®ã¯Ruby on RailsサーバとJettyサーバとを分ける必要があったためã ã£ããããããã®ä»ã«ãããããããåä¸ãã¡ã¤ã³ã¸ã®ãã©ã¦ã¶ã³ãã¯ã·ã§ã³å¶éã®è§£æ±ºããã£ãã ãããããããWeb AIMã®JSONP Cometã«ã¤ãã¦ã¯ãããããç´ç²ã«APIã¨ããå½¢ã§ä»ã®ãµã¤ãããã¯ãã¹ãã¡ã¤ã³ã§ä½¿ãããã ãããã¡ãªã¿ã«ã¤ãã³ãå¾ ã¡ã®JSONPãªã¯ã¨ã¹ãã®URLã¯ããã®ä»ã®APIã§æ¥ç¶ãããã¹ãã¨ã¯ç°ãªãURLã«ãªããããããã®ããåä¸ãã¡ã¤ã³ã®æ¥ç¶å¶éãåé¿ãããï¼ãã¶ãï¼
Web AIMã®JavaScriptã«ããå®è£
ä¾ã«ã¤ãã¦ã¯こちらï¼dojoå©ç¨ãiPhone ãæèããUIï¼ãã¡ãªã¿ã«ãWebAIMãã©ããããå½¢ã§ãã¢ããªããç°¡åã«ä½¿ããããã«AIM Whimsicalsã¨ããã®ãããã
ææ
AOL AIM ã使ãã²ã¨ã£ã¦ããã»ã©å¤ããªãã¨æãã®ã§ãå®è³ªãã®APIã®ã¤ã³ãã¯ãã¯èãã¨æããå年以ä¸ãæ¥æ¬ã§ç¡è¦ããã¦æ¥ãï¼ããã«æããï¼ã®ã¯ããããçç±ã®ä¸ã¤ã ããããã ããããã¾ããWebãµã¼ãã¹ã®APIãä½ããã¨ãã人ã§ããã®å®è£ ã®éè¦ãã«å ±æãã¦ããã人ã¯ããã²ã¾ããã¦ï¼åèã«ãã¦ï¼ã»ããããã¡ãããå½¼ããã¡ããã¨æ°ã«ãã¦ããã»ãã¥ãªãã£ã®ã¨ããã¾ã§ç解ãã¦ã³ãã¼ããªãã¨é§ç®ã ãã©ããã£ã¨ä»æ´Twitterã®APIãã¾ããã®ãªããWeb AIMãã¾ããæ¹ã絶対ãã£ãããã
ã»ãã¥ãªãã£ã®é¢ãããã®å®è£ ã«å¯¾ãã¦æççãªäººã¯ããã²ãªãããã§ã¯é§ç®ãªã®ããæ¤è¨¼ãã¦ãããã¦ãããã°æãã¦ã»ãããAOLããã£ã¦ãããã£ã¦çµ¶å¯¾ç©´ããªããã¨ãããã¨ã¯ãªãã ããããããããæå³ã§ã¯ä¸ã®æ®µè½ã§å®æã«ã³ãã¼ãå§ããã®ã¯è»½çã ã£ããããããªããã©ãã
ææï¼
JSONP Cometã®APIã¯ãéç¥ã®ã¤ã³ãã©ã¨ãã¦ä½¿ããããããªãããã¨æããä¾ãã°ããã¦ã¼ã¶ããªã³ã¯ãã¯ãªãã¯ããããä»ã®åéã¦ã¼ã¶ã«ã¯ãªãã¯æ å ±ãé ä¿¡ããã¦ç»é¢ãæ´æ°ãããã¨ãããã¨ãµã¼ãã¬ã¹ãªã®ãæ´»ããã¦èªåã®ããã°ã«åãè¾¼ãã§ãããã°è¨ªåè ã«å¯¾ãã¦IMã§å®£ä¼ãæµãã¨ãï¼ãããï¼
ææï¼
ãJSONPã§ç§å¯æ å ±ã«ã¢ã¯ã»ã¹ããããªãã¨ããæãã¯ããã¶ãã»ãã¥ãªãã£ãä½ãèãã¦ãªãã²ã©ãå®è£ ãé¿ããããã®æãã ã¨è§£éãã¦ããã®ã§ããã誰ããããã§æèåæ¢ãã¦ãããããã®å®è£ ã¯åºã¦ããªãã£ãã®ã§ã¯ãªãããªãã