Amebaなう(アメーバなう)はRSSフィードやつぶやきのpermalinkが無いのが難点(´д`)

ただ、XML を取得できる Rest な Web API があるらしく(隠しAPI)、情報がいろいろなところに流れてる。

どうやらこれらのAPIは普通にリンク(たとえばこれ⇒ http://now.ameba.jp/api/timeline)をクリックしても見れないみたい。
リファラがついているとXMLを返してくれない(Amebaなうのトップページが返ってきたりする)。
なので、ブラウザから見るときにはURLをロケーションバーに入力しないといけない。

# ちなみに自分は Firefox の PrefBar で Referrer を止めてる(^_^;)

ためしにいくつかAPIを見てみる。

http://now.ameba.jp/api/timeline

このURLはAmebaにログインしていないと見れないっぽい。

http://now.ameba.jp/api/timeline の中身はこんな感じ(タブやら改行やら整形済み)。
isMyEntry や replyEntryId が興味深い。


<?xml version="1.0" encoding="utf-8" ?>
<response>
  <entryList offset="21">
    <entry>
      <amebaId>tyu-toreal</amebaId>
      <entryId>621106</entryId>
      <entryText>辻ちゃんが5320人。</entryText>
      <replyAmebaId>film-nikon-f7</replyAmebaId>
      <replyEntryId>619511</replyEntryId>
      <replyNickname>※ 青色明細‥?</replyNickname>
      <thumbnailNickname>中途リアル</thumbnailNickname>
      <thumbnailImagePath>http://a248.e.akamai.net/f/248/26693/24h/stat.profile.ameba.jp/profile_images/20091123/14/48/31/g/o014501451258952696562.gif</thumbnailImagePath>
      <thumbnailImageWidth>145</thumbnailImageWidth>
      <thumbnailImageHeight>145</thumbnailImageHeight>
      <originalImageUrl></originalImageUrl>
      <thumbnailImageUrl></thumbnailImageUrl>
      <registDateStr>0分前</registDateStr>
      <entryDeviceStatus>2</entryDeviceStatus>
      <isMyEntry>0</isMyEntry>
      <denyReplyFlag>0</denyReplyFlag>
    </entry>
    <entry>
      <amebaId>food-stadium</amebaId>
      <entryId>621091</entryId>
      <entryText>恐縮です。名古屋マーケット情報チェックします。ブログ読者登録させていただきました。</entryText>
      <replyAmebaId>macky-hi</replyAmebaId>
      <replyEntryId>618533</replyEntryId>
      <replyNickname>Rainbow Rimbaud</replyNickname>
      <thumbnailNickname>つぶやき編集長こうぞう</thumbnailNickname>
      <thumbnailImagePath>http://a248.e.akamai.net/f/248/26693/24h/stat.profile.ameba.jp/profile_images/29/food-stadium/1250839671319.jpg</thumbnailImagePath>
      <thumbnailImageWidth>168</thumbnailImageWidth>
      <thumbnailImageHeight>200</thumbnailImageHeight>
      <originalImageUrl></originalImageUrl>
      <thumbnailImageUrl></thumbnailImageUrl>
      <registDateStr>0分前</registDateStr>
      <entryDeviceStatus>2</entryDeviceStatus>
      <isMyEntry>0</isMyEntry>
      <denyReplyFlag>0</denyReplyFlag>
    </entry>
(中略)
  </entryList>
</response>

サンプルファイル

Amebaなうを Ruby でいじってみた - ~fumi/ChangeLog によると「http://now.ameba.jp/api/timeline?limit=20&offset=0」って感じの limit や offset パラメータがあるらしい。

http://now.ameba.jp/api/entryList/{amebaId}

http://now.ameba.jp/api/entryList/nilab だとこんな感じ(タブやら改行やら整形済み)。
このURLはログインしていなくても見ることができる。

誰かへの返事(Re:)には replyAmebaId, replyEntryId, replyNickname が設定される。
また、画像を貼り付けていると originalImageUrl や thumbnailImageUrl にURLが設定される。


<?xml version="1.0" encoding="UTF-8"?>
<response>
  <entryList isMyEntry="0" isLogin="0" offset="20">
(中略)
    <entry>
      <amebaId>nilab</amebaId>
      <entryId>403650</entryId>
      <entryText>きょうは全国的に&lt;img src="http://stat.ameba.jp/blog/ucs/img/char/char2/021.gif" alt="雨" class="e021" /&gt;みたいですね</entryText>
      <replyAmebaId>harukakanoh</replyAmebaId>
      <replyEntryId>394601</replyEntryId>
      <replyNickname>harukakanoh</replyNickname>
      <imageId>0</imageId>
      <originalImageUrl/>
      <thumbnailImageUrl/>
      <registDateStr>きのう</registDateStr>
      <entryDeviceStatus>2</entryDeviceStatus>
      <denyReplyFlag>0</denyReplyFlag>
    </entry>
    <entry>
      <amebaId>nilab</amebaId>
      <entryId>399147</entryId>
      <entryText>2日前に撮ったミッドランドスクエアのトナカイです&lt;img src="http://stat.ameba.jp/blog/ucs/img/char/char2/123.gif" alt="キラキラ" class="e123" /&gt;&lt;img src="http://stat.ameba.jp/blog/ucs/img/char/char2/314.gif" alt="馬" class="e314" /&gt;</entryText>
      <replyAmebaId/>
      <replyEntryId/>
      <replyNickname/>
      <imageId>0</imageId>
      <originalImageUrl>http://stat.ameba.jp/user_images/20091211/08/nilab/34/30/j/o0240032010336996071.jpg</originalImageUrl>
      <thumbnailImageUrl>http://stat.ameba.jp/user_images/20091211/08/nilab/34/30/j/t02200293_0240032010336996071.jpg</thumbnailImageUrl>
      <registDateStr>きのう</registDateStr>
      <entryDeviceStatus>2</entryDeviceStatus>
      <denyReplyFlag>0</denyReplyFlag>
    </entry>
(中略)
  </entryList>
</response>

サンプルファイル

http://now.ameba.jp/api/entry/{amebaId}/{entryId}

http://now.ameba.jp/api/entry/nilab/407191 だとこんな感じ(タブやら改行やら整形済み)。
このURLはログインしていなくても見ることができる。


<?xml version="1.0" encoding="UTF-8"?>
<response>
  <entryList isLogin="0" isPaging="0" offset="" replyAmebaId="" replyEntryId="0">
    <entry>
      <amebaId>nilab</amebaId>
      <entryId>407191</entryId>
      <entryText>PCからはじめて投稿なう(*^▽^*)&lt;img src="http://stat.ameba.jp/blog/ucs/img/char/char2/038.gif" alt="音符" class="e038" /&gt;</entryText>
      <replyAmebaId/>
      <replyEntryId/>
      <replyNickname/>
      <thumbnailNickname>NI-Lab.</thumbnailNickname>
      <thumbnailImagePath>http://a248.e.akamai.net/f/248/26693/24h/stat.profile.ameba.jp/profile_images/20091022/20/05/75/j/o016001601256212801325.jpg</thumbnailImagePath>
      <thumbnailImageWidth>160</thumbnailImageWidth>
      <thumbnailImageHeight>160</thumbnailImageHeight>
      <originalImageUrl/>
      <thumbnailImageUrl/>
      <registDateStr>きのう</registDateStr>
      <entryDeviceStatus>1</entryDeviceStatus>
      <isMyEntry>0</isMyEntry>
      <denyReplyFlag>0</denyReplyFlag>
    </entry>
  </entryList>
</response>

サンプルファイル

tags: zlashdot WebServices Ameba

Posted by NI-Lab. (@nilab)