From 79cf6591ca2c3f242b2ebb6c38048d4ee1b974a0 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 9 May 2008 04:14:38 +0000 Subject: * ,fでfav git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@11289 d0d07461-0603-4401-acd4-de1884942a52 --- twitterView.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'twitterView.js') diff --git a/twitterView.js b/twitterView.js index cbd27d6..7db6c63 100644 --- a/twitterView.js +++ b/twitterView.js @@ -1,5 +1,5 @@ // Vimperator plugin: 'Statusbar Twitter' -// Last Change: 23-Apr-2008. Jan 2008 +// Last Change: 09-May-2008. Jan 2008 // License: Creative Commons // Maintainer: Trapezoid - http://unsigned.g.hatena.ne.jp/Trapezoid // @@ -63,6 +63,15 @@ setInterval(checkTimeline ,checkTime); setInterval(updateTimeline ,updateTime); + function favoriteStatus(id){ + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function(){ + if(xhr.readyState == 4 && xhr.status != 200) + liberator.echoerr("Twitter Viewer: faild to favorite"); + }; + xhr.open("GET","http://twitter.com/favourings/create/" + id,true,username,password); + xhr.send(null); + } function checkTimeline(){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ @@ -96,4 +105,7 @@ liberator.mappings.addUserMap([liberator.modes.NORMAL], [",r"], "Reply to current user", function () { liberator.commandline.open(":", "twitter @" + lastestStatus.user.screen_name + " ", liberator.modes.EX); }); + liberator.mappings.addUserMap([liberator.modes.NORMAL], [",f"], + "Favorite to current user", + function () { favoriteStatus(lastestStatus.id) }); })(); -- cgit v1.2.3