aboutsummaryrefslogtreecommitdiffstats
path: root/twitter.js
diff options
context:
space:
mode:
authortrapezoid2008-06-17 09:58:56 +0000
committertrapezoid2008-06-17 09:58:56 +0000
commita8309de66690c2d22afdae99c78b43f98ad12423 (patch)
treeb2264a71381278cf7bcaeb7e3f3603955e1c83cd /twitter.js
parentac1645005aa9530f8b160734857f202cefbb0599 (diff)
downloadvimperator-plugins-a8309de66690c2d22afdae99c78b43f98ad12423.tar.bz2
twitter! userでuserのタイムラインをechoで表示するように。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@14167 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'twitter.js')
-rw-r--r--twitter.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/twitter.js b/twitter.js
index ad2e9ef..229fbf5 100644
--- a/twitter.js
+++ b/twitter.js
@@ -1,5 +1,5 @@
// Vimperator plugin: "Update Twitter"
-// Last Change: 10-Apr-2008. Jan 2008
+// Last Change: 11-May-2008. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
//
@@ -18,9 +18,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://twitter.com/statuses/friends_timeline.json", false, username, password);
+ var endPoint = target ? "http://twitter.com/statuses/user_timeline/" + target + ".json"
+ : "http://twitter.com/statuses/friends_timeline.json";
+ xhr.open("GET", endPoint, false, username, password);
// for debug
//xhr.open("GET", "http://twitter.com/statuses/user_timeline/otsune.json", false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -62,13 +64,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
sayTwitter(username, password, arg);
},