iPhoneのTumblrリブログ用のアプリ iviewのsiteinfoをいくつか書きました。

iPhoneのTumblrアプリで大好きなアプリのひとつにiviewというものがある。 Tumblrの画像リブログ専門のアプリで「いいな」と思った画像をホイホイリブログできるので手放せない。

このiviewの特色は、自分のダッシュボードやあらかじめ登録されているサイトの他にも、他の画像系サイトを登録しておくことにより、いろいろなサイトの画像をリブログのソースとして使用することができることだ。

Photo_29-01-2012_12_47_47

登録はSetup画面のSubscribe to other sourcesからwedataに置かれているiview用のsiteinfoを読み込むことによって行う。 またsiteinfoを自作してiPhoneからアクセスできる適当なwebサーバーから読み込ませて登録することも可能だ。

(download)

ところが最近はwedataのほうのsiteinfoも更新されていないようで、すでに動かなくなったものもけっこうあったり、新たらしめのサービスに関してはsiteinfoも作成されてなかったりするので、自分がよく使うサービスを中心にxpathの取得の仕方の勉強も兼ねていくつかsiteinfoを書いてみた。

iview用のsiteinfoの仕様は作者の『Wedataのiview用データベースSITEINFO仕様 « ku』を参考にさせてもらった。

siteinfoは 500pxPinterestWe Heart ItPiccsyなど以下の内容をjsonファイルとして作成し上述のように適当なwebサーバーから取り込むことによってiviewから使用可能になる。

 

[

{

   "created_at" : "2008-08-20T23:13:53+09:00",

   "created_by" : "ku",

   "data" : {

      "nextLink" : "//div[@class='older']/a",

      "paragraph" : "//div[@class='catalog']",

      "permalink" : "./div/a",

      "subRequest.caption" : ".//h2",

      "subRequest.imageSource" : ".//img",

      "subRequest.paragraph" : "id('canvas')",

      "url" : "http://weheartit.com/"

   },

   "database_resource_url" : "",

   "name" : "WeHeartIt2",

   "recreated_by" : "toshi",

   "resource_url" : "",

   "updated_at" : "2012-01-015T12:33:00+09:00"

},

{

   "created_at" : "2012-01-06T21:31:53+09:00",

   "created_by" : "toshi",

   "data" : {

      "nextLink" : "id('pager')//a[@class='last']",

      "paragraph" : "//div[@class='image']",

      "permalink" : "./a",

      "subRequest.caption" : "id('indivPost-rightColumn')/h3",

      "subRequest.imageSource" : "id('indivPost-leftColumn')/img",

      "subRequest.paragraph" : "id('wrapper')",

      "url" : "http://piccsy.com/"

   },

   "database_resource_url" : "",

   "name" : "Piccsy",

   "resource_url" : ""

},

{

   "created_at" : "2011-12-31T23:15:04+09:00",

   "created_by" : "toshi",

   "data" : {

      "nextLink" : "id('pager')//a[@class='last']",

      "paragraph" : "//div[@class='image']",

      "permalink" : "./a",

      "subRequest.caption" : "id('indivPost-rightColumn')/h4[1]",

      "subRequest.imageSource" : "id('indivPost-leftColumn')/img",

      "subRequest.paragraph" : "id('wrapper')",

      "url" : "http://hellokisses.com/"

   },

   "database_resource_url" : "",

   "name" : "HelloKisses",

   "resource_url" : "",

   "updated_at" : "2011-12-31T23:15:04+09:00"

},

{

   "created_at" : "2012-01-07T12:39:00+09:00",

   "created_by" : "toshi",

   "data" : {

      "nextLink" : "//div[@class='pagination']/a[@class='next_page']",

      "paragraph" : "//div[@class='photos profile clearfix']",

      "permalink" : "./div/a",

      "subRequest.caption" : ".//h1",

      "subRequest.imageSource" : "./div[2]/div/a/img",

      "subRequest.paragraph" : "//div[@class='wrapper clearfix']",

      "url" : "http://500px.com/popular"

   },

   "database_resource_url" : "",

   "name" : "500px_Popular",

   "resource_url" : ""

},

{

   "created_at" : "2012-01-07T14:28:00+09:00",

   "created_by" : "toshi",

   "data" : {

      "paragraph" : "//div[@class='pin']",

      "permalink" : "./a",

      "subRequest.caption" : "./div[4]//text()",

      "subRequest.imageSource" : "./div[3]//img",

      "subRequest.paragraph" : "//div[@class='WhiteContainer clearfix']",

      "url" : "http://pinterest.com"

   },

   "database_resource_url" : "",

   "name" : "Pinterest",

   "resource_url" : ""

},

{

   "created_at" : "2012-01-18T13:46:00+09:00",

   "created_by" : "toshi",

   "data" : {

      "paragraph" : "//table/tr/td",

      "permalink" : ".//a",

      "subRequest.imageSource" : "./img",

      "subRequest.paragraph" : "//center[1]",

      "url" : "http://up4.jp"

   },

   "database_resource_url" : "",

   "name" : "up4.jp",

   "resource_url" : ""

}

]

 

 

なお作成した上記のjsonファイルはここにも置いておくので好きなようにどうぞ。

とあるサイトはタグで絞込みができたりするのでurlを少し書き換えて 「?tag=ass」などと付け加えるとその筋の人にうけるかもしれない。

 

 

Posted