From b29bb95fcc72ab76eed616169ed35ca56f9b8d88 Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 19 Jun 2008 09:39:24 +0000 Subject: * twitter.jsと同様に「:wassr! user」で対象ユーザのステータスを表示するよう修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@14257 d0d07461-0603-4401-acd4-de1884942a52 --- wassr.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'wassr.js') diff --git a/wassr.js b/wassr.js index 0788f5b..375313f 100644 --- a/wassr.js +++ b/wassr.js @@ -1,5 +1,5 @@ // Vimperator plugin: "Update Wassr" -// Last Change: 09-Jun-2008. Jan 2008 +// Last Change: 19-Jun-2008. Jan 2008 // License: Creative Commons // Maintainer: mattn - http://mattn.kaoriya.net/ // Based On: twitter.js by Trapezoid @@ -36,9 +36,11 @@ while (re.test(result) && i < arguments.length) result = result.replace(re, arguments[i++]); return result; } - function showFollowersStatus(username, password){ + function showFollowersStatus(username, password, target){ var xhr = new XMLHttpRequest(); - xhr.open("GET", "http://api.wassr.jp/statuses/friends_timeline.json", false, username, password); + var endPoint = target ? "http://api.wassr.jp/user_timeline.json?id=" + target + : "http://api.wassr.jp/statuses/friends_timeline.json"; + xhr.open("GET", endPoint, false, username, password); // for debug //xhr.open("GET", "http://api.wassr.jp/statuses/user_timeline/otsune.json", false, username, password); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); @@ -177,13 +179,11 @@ liberator.echoerr(ex); } - if (special){ - arg = arg.replace(/%URL%/g, liberator.buffer.URL) - .replace(/%TITLE%/g, liberator.buffer.title); - } + arg = arg.replace(/%URL%/g, liberator.buffer.URL) + .replace(/%TITLE%/g, liberator.buffer.title); - if (!arg || arg.length == 0) - showFollowersStatus(username, password); + if (special || arg.length == 0) + showFollowersStatus(username, password, arg); else if (arg.match(/^-todo(.*)/)) todoAction(username, password, RegExp.$1); @@ -200,6 +200,8 @@ ], completer: function(filter) { candidates = []; + if (filter.match(/{emoji:$/)) { + } else if (filter.match(/-todo$/)) { candidates = [ ['-todo+', 'add todo'], -- cgit v1.2.3