ついったーからふぁぼったーを開くブックマークレット2
以前作ったのはこれ。
前のやつは twitter の Permalink ページ(http://twitter.com/{UserID}/(statuses|status)/{PostID})から http://favotter.matope.com/status.php?id={PostID} を開くだけだったけど、ユーザートップ(http://twitter.com/{User})からは http://favotter.matope.com/user.php?user={UserID} が開くようにした。
javascript:var u=document.URL;f="http://favotter.matope.com/";if (u.indexOf("status") == -1) {window.open(f+"user.php?user="+u.substring(u.lastIndexOf("/")+1,u.length));undefined;}else{window.open(f+"status.php?id="+u.substring(u.lastIndexOf("/")+1,u.length));undefined};
UserID に status が含まれてる人のページでは使えません。
メモ
if(hogehoge){void(window.open("hoge"));}else{void(window.open("fuga"));}
というふうに void() を2回使ったら動かなかったので undefined を使った。