javaã§ã¯ã¦ãªããã¯ãã¼ã¯AtomAPIã使ã
ã¯ã¦ãªjigletãå¯ã®RSSãªã¼ãã¼ã«ãªããªãçºã«ãã¯ã¦ãªããã¯ãã¼ã¯æ稿æ©è½ãä»ãããã¨ã«ãã¾ããã
ãã®ããã«å¿
è¦ãªã®ãはてなブックマークAtomAPIï¼
AtomAPIã£ã¦ååã¯èãããã¨ããã£ãã®ã§ããããããªãã ã£ããã§ããã
è¦ãã¦ããã¡ã«ã¡ã¢æ®ãã¦ãããã¨ã«ãã¾ãã
AtomAPIããã¯ã¦ãªããã¯ãã¼ã¯AtomAPIã®è©³ããä»æ§ã«ã¤ãã¦ã¯
ä¸ã®ãªã³ã¯ãã辿ã£ã¦è¦ã«è¡ã£ã¦ãã ããã
ã©ãããæãã¤ããã°ããã®ã
ã¨ãããããããã§åããã¨ãã¦ã人ãããªãããæ¤ç´¢ãããã1件ã ãjavaã§åããã¨ããã£ã¦ã人ã®è¨äºãè¦ã¤ãã¾ããã
yohei-y:weblog: Java からはてなフォトライフAtomAPIを使う
ããã¯ãã©ãã©ã¤ãAtomAPIã§ãããããã¯ãã¼ã¯ã§ãåãã§ãã
ã»ã¨ãã©ãã丸åãã§ããã¾ãã
ãããã¨ããããã¨ãã
ãã ãããã¯ã«ã¼ãAtomã¨ã³ããã¤ã³ãã«å¯¾ãGETãªã¯ã¨ã¹ããè¡ã£ã¦ãã ããªã®ã§
ã¯ã¦ãªããã¯ãã¼ã¯ãæ稿ããå ´åããã®å¾ã«ãè²ã
ãããã¨ã¯ããã¾ãã
WSSEèªè¨¼
âã§ç´¹ä»ããããã°ãã³ããããã°ãä½ãè²ã
ãªæ
å ±ãã¤ã¾ã£ãxmlãè¿ã£ã¦ãã¦ã
ããã解æããã°æ稿ãç·¨éãã§ãããã ãããªã¨æã£ã¦ããã®ã§ããã失æãã¾ããã
解æã¯æåãã¦ãããããå¾ãPostURIã«GETãªã¯ã¨ã¹ããéã£ãã®ã§ãã
ãªããæ£å¸¸ãªã¬ã¹ãã³ã¹ãè¿ã£ã¦ããªãã»ã»ã»ã»ã
åå ã¯ãWSSE認証ã«å¯¾ãã誤ã£ãèãæ¹ã§ããã
WSSEèªè¨¼ã¯HTTPã®X-WSSEããããç¨ãã¦èªè¨¼ç¨æååãéä¿¡ããèªè¨¼æ段ã§ãã
âã®éããWSSEèªè¨¼ã¨ã¯ããªã¯ã¨ã¹ãã®ãããã«X-WSSEããããä»ãå ãããã®ã§ãã
X-WSSEãããã®ä»ãå ãæ¹ã¯ãâã§ç´¹ä»ããããã°è¨äºã«æ¸ãã¦ããã¾ãã
ãã®é¨åã¯ç解ã§ããã®ã§ããããªããåéããã¦ãã¾ã£ã¦
ã«ã¼ãAtomã¨ã³ããã¤ã³ãã«å¯¾ããGETãªã¯ã¨ã¹ãã®ãããã¼ã«ã ãX-WSSEãä»ãå ããã°ããã¨èãã¦ãã¾ã£ã¦ãã¾ããã
ã§ããå®éã¯ããã®å¾ã®PostURIãªã©ã«ãªã¯ã¨ã¹ããéãæãX-WSSEãããã¼ãä»ããå¿
è¦ããã£ãã¿ããã§ãã
ã¯ã¦ãªã®èª¬æãã¼ã¸åããã«ãããï¼ï½
ä»èããã¨å½ç¶ãªãã§ããã©ãã»ã»ã»ãå®éã«ã¯ã¦ãæ稿ããæã«å¿ è¦ãªèªè¨¼ãªããã§ãããã
ã¨ããããã§ãªã¯ã¨ã¹ãã«X-WSSEããããä»ããããæ£å¸¸ãªã¬ã¹ãã³ã¹ãè¿ã£ã¦ãã¾ããã
ãã¨ã¯xmlã®è§£æãé å¼µãã°ãã¯ã¦ãªããã¯ãã¼ã¯ã®æ稿ã§ãç·¨éã§ãä½ã§ãã§ãã¾ãã
ãã¨ãã
xmlã®è§£æã¯ã¨ã³ããªã¼åå¾ã®æã«åãã¦ããã¾ãããã
è²ã
使ãå ´é¢ãå¤ãããªã®ã§åå¼·ãã¦ããã£ãã¨å®æãã¾ããã
ãããªãAtomAPIã§ä½¿ããã¨ã«ãªã£ãããï½
jigletã®æ¹ã¯ããã»ã¼å®æãã¦ããã®ã§ãããããå
¬éãããã¨æãã¾ãã
追è¨
403ã¨ã©ã¼ã«ãªãæ¹ã¯ãã¡ããåèã«ã©ãã
はてなブックマークAtomAPIで403 解決編 - てきろぐ(仮)