aboutsummaryrefslogtreecommitdiffstats
path: root/haiku.js
diff options
context:
space:
mode:
authormattn2008-08-22 10:04:56 +0000
committermattn2008-08-22 10:04:56 +0000
commit41378fc2905a841425e09effc6616f4fc25982f4 (patch)
tree15ab0036619e67109cb6f1bef054cf2d382c3f93 /haiku.js
parentca1ef4136895eed25930d91b55a064464b265637 (diff)
downloadvimperator-plugins-41378fc2905a841425e09effc6616f4fc25982f4.tar.bz2
:haiku!/ でpublic_timelineを表示する様修正
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@18067 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'haiku.js')
-rw-r--r--haiku.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/haiku.js b/haiku.js
index 5520d61..e12c356 100644
--- a/haiku.js
+++ b/haiku.js
@@ -10,6 +10,8 @@
// post "some thing text" to keyword 'id:username' on hatena haiku.
// :haiku #keyword some thing text
// post "some thing text" to keyword 'id:keyword' on hatena haiku.
+// :haiku!/
+// show public timeline.
// :haiku! someone
// show someone's statuses.
// :haiku!+ someone
@@ -50,7 +52,7 @@
xhr.open("POST", "http://h.hatena.ne.jp/api/statuses/user_timeline/" + user + ".json", false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(null);
- xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/create/" + window.eval(xhr.responseText)[0].id + '.json', false, username, password);
+ xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/create/" + evalFunc(xhr.responseText)[0].id + '.json', false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(null);
}
@@ -59,14 +61,17 @@
xhr.open("POST", "http://h.hatena.ne.jp/api/statuses/user_timeline/" + user + ".json?count=1", false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(null);
- xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/destroy/" + window.eval(xhr.responseText)[0].id + '.json', false, username, password);
+ xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/destroy/" + evalFunc(xhr.responseText)[0].id + '.json', false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(null);
}
function showFollowersStatus(username, password, target){
var xhr = new XMLHttpRequest();
- var endPoint = target ? "http://h.hatena.ne.jp/api/statuses/user_timeline/" + target + ".json"
- : "http://h.hatena.ne.jp/api/statuses/friends_timeline.json";
+ var endPoint = target ?
+ target == "/" ?
+ "http://h.hatena.ne.jp/api/statuses/public_timeline.json"
+ : "http://h.hatena.ne.jp/api/statuses/user_timeline/" + target + ".json"
+ : "http://h.hatena.ne.jp/api/statuses/friends_timeline.json";
xhr.open("POST", endPoint, false, username, password);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(null);