(éçºè åã) ã¯ã¦ãªãã¤ã¯APIããã¼ã¸ã§ã³ã¢ãããã¾ãã
ã¯ã¦ãªãã¤ã¯ã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ããã¯ã¦ãªãã¤ã¯APIããã¼ã¸ã§ã³ã¢ãããã¾ããã
主ãªå¤æ´ç¹ã¯ä»¥ä¸ã®éãã§ãã詳細㯠Hatena Developer Center ã®ããã¥ã¡ã³ãããåç §ãã ããã
OAuth ã«å¯¾å¿ãã¾ãã
èªè¨¼æ¹å¼ã¨ã㦠OAuth ã«å¯¾å¿ãã¾ãããèªã¿åãæä½ã«ã¤ãã¦ã¯ read_public
権éãæ¸ãè¾¼ã¿ã»åé¤æä½ã«ã¤ãã¦ã¯ write_public
権éã§è¡ãã¾ãã
ããã¾ã§ã® HTTP Basic èªè¨¼ãå¼ãç¶ãæä¾ãã¾ãããä»å¾ã¯éæ¨å¥¨ã¨ãã OAuth ã®å©ç¨ãæ¨å¥¨ãã¾ãã Basic èªè¨¼ãå»æ¢ããäºå®ã¯ç¾æç¹ã§ã¯ãããã¾ãããã OAuth ã¸ã®ç§»è¡ã®ç¶æ³ãè¦ã¦æ¤è¨ãã¦ããã¾ãã
@ ã«ããèªåè¿ä¿¡æ©è½ãå»æ¢ãã¾ãã
statuses/update
ã® status
ã«ã¯
å é ã® @id 㯠id ããã®æå¾ã®ã¨ã³ããªã¼ã¸ã®è¿ä¿¡ã«ãªãã¾ãã
http://developer.hatena.ne.jp/ja/documents/haiku/apis/rest#statuses-update
... ã¨ã®æ©è½ãããã¾ããããAPI ç¬èªã®æ©è½ã§ããæ··ä¹±ãæããããæ°ãã¼ã¸ã§ã³ã§ã¯å»æ¢ãã¾ããã@idãã¯åãªãæååã¨ãã¦æ±ãã¾ããè¿ä¿¡ã¨ãããå ´åã¯æ示çã« in_reply_to_status_id
ã§è¿ä¿¡å
ã¨ã³ããªã¼ã® ID ãæå®ãã¦ãã ããã
æ稿æ¬æã® body_formats
å¼æ°ãæ°è¨ãã¾ãã
æ稿ãåå¾ãã statuses/show
ãªã©ã«æ°ãã«å¼æ°ã¨ã㦠body_formats
ã追å ãã¾ããã body_formats=haiku
, body_formats=html,html_touch
ãªã©ã¨ãããã¨ã§ãã¯ã¦ãªè¨æ³ãå¦çããåã®ããã¹ããå¦çå¾ã® HTML ãåå¾ã§ãã¾ãã
ãã¹ã¦ã®ãã¼ã¯ã¼ãã®æ å ±ãåå¾ã§ããããã«ãã¾ãã
ãã¼ã¯ã¼ãã®æ
å ±ãåå¾ãã keywords/show
ãªã©ã«æ°ãã«å¼æ°ã¨ã㦠word
ã追å ãã¾ãããããã¾ã§ã® keywords/show/Hatena%20Haiku.json
ã®ãããªæå®æ¹æ³ã§ã¯ããã¼ã¯ã¼ãåã«è¨å·ãå«ã¾ããå ´åã«æ£å¸¸ã«çµæãåå¾ã§ããªããã¨ãããã¾ããä»å¾ã¯ word
å¼æ°ã使ã£ã keywords/show.json?word=Hatena%20Haiku
ã®ãããªæå®æ¹æ³ãæ¨å¥¨ãã¾ãã
ãã¼ã¯ã¼ãä¸è¦§ã® without_related_keywords
å¼æ°ãæ°è¨ãã¾ãã
ãã¼ã¯ã¼ãä¸è¦§ãåå¾ãã keywords/list
㨠keywords/hot
ã«æ°ãã«å¼æ°ã¨ã㦠without_related_keywords
ã追å ãã¾ããã without_related_keywords=1
ã¨ãããã¨ã§ãé¢é£ãã¼ã¯ã¼ãã®ãªã¹ããçµæã«å«ã¾ããªããªãã¾ããé¢é£ãã¼ã¯ã¼ãã®æ
å ±ãå©ç¨ããªãã¢ããªã±ã¼ã·ã§ã³ã§ã¯ãããé«éã«åä½ãããã®ãªãã·ã§ã³ã®å©ç¨ãæ¨å¥¨ãã¾ãã
ãã¡ã³ã»ãæ°ã«å
¥ããã¼ã¯ã¼ãã®ä¸è¦§ã« page
å¼æ°ãæ°è¨ãã¾ãã
ãã¡ã³ã®ä¸è¦§ãåå¾ãã statuses/followers
ã¨ãæ°ã«å
¥ããã¼ã¯ã¼ãã®ä¸è¦§ãåå¾ãã statuses/keywords
ã«æ°ãã«å¼æ°ã¨ã㦠page
ã追å ãã¾ããããããã®ä¸è¦§ã«å«ã¾ããã¦ã¼ã¶ã¼ããã¼ã¯ã¼ãã¯1ãã¼ã¸ãããæ大100件ã¾ã§ã§ããã以ä¸ã¯ page=2
ãªã©ã¨æå®ããã¨åå¾ã§ãã¾ããããã¯ãæ°ã«å
¥ãã¦ã¼ã¶ã¼ã®ä¸è¦§ statuses/friends
ã¨åãä»æ§ã§ãã
Web ãã¼ã¸ã®ãã©ã¼ã ã«ãã£ã«ã¤ã³ã§ããããã«ãªãã¾ãã
API ã§ã¯ããã¾ããããã¯ã¦ãªãã¤ã¯ã® URL ã«å¼æ°ã¨ã㦠word
ã body
ã
http://h.hatena.ne.jp/?word=Hatena%20Haiku&body=Hello,%20New%20Haiku%21
... ã®ããã«æå®ãããã¨ã§ããé¡ãæ¬æã«æååãæå®ããç¶æ ã§ãã¼ã¸ãéããã¨ãã§ããããã«ãªãã¾ããã
æ稿ãã¿ã³ã®ç»å (http://h.hatena.ne.jp/images/haiku-button.png) ããç¨æãããã¾ããã®ã§ãã©ãããå©ç¨ãã ããã