2007年12月05日
■ [LDRize][Minibuffer][Reblog] LDRize+Minibuffer+tumblr reblog commandでピンつけてReblogしてるけどたまに失敗して変なQuoteが投稿される

こんなの。
YouTube has given the world a domain name, and some servers. We gave YouTube a household name, and some grainy camcorder videos. The 30-second clips recorded on a cell phone of the last Usher concert are not, in reality, worth the hard drive space. Neither are the endless videos of people in their all-American backyards blowing stuff up and disgracing their families.
A snarky attempt at describing what I do.
http://andres.tumblr.com/post/603
失敗した投稿をDashboardから普通にReblogするとうまくいく。
userscriptのバージョンは2007.11.20。あとでアップデートしてみる。それでダメならソース見て原因を調べる。
追記 (12月5日 5時5分)
解決した。
悪さをしてたのはLDRize Mibuffer tumblr reblog command。この記事を書いている時点でのuserscript最新バージョン2007.11.20.3の345行目の正規表現:
if ( u && u.match( /\/(\d+)/ ) ) {
では,おそらく各投稿の固定リンクURL(例えば http://hoge.tumblr.com/post/12345678)から末尾のID(12345678)を取得しようとしてるんだけど,その先頭が数字列であるようなユーザの投稿をReblogしようとすると,IDではなくその数字列が正規表現にマッチしてしまう。
実際,Reblogに失敗してたのは http://603.tumblr.com/post/ID をReblogしようとしてたときだった。
てなわけでこの正規表現をちゃんと末尾のIDにマッチするように:
if ( u && u.match( /\/(\d+)$/ ) ) {
と書き換えてやればOK。これで正常にReblogできるようになった。
スクリプトの製作者にトラックバックを送っておこう。
ku05222007/12/05 12:51ありがとうございますー。(\d+)$だとtumblr側の気まぐれで#とか?がつくようになったらマッチしなくなるのでpost/(\d+)で修正しました!
SweetPotato2007/12/05 13:40こちらこそ対応ありがとうございます。確かにその正規表現の方が意図通りにマッチしますね。速攻でアップデートしました。