From 914dcbc352bfa480467ddf15b9a860edf03eecb1 Mon Sep 17 00:00:00 2001 From: anekos Date: Sun, 15 Aug 2010 05:52:59 +0000 Subject: echo のフォーマットを統一するためにまとめる git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38273 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index ef9ca13..50ead27 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1023,7 +1023,7 @@ let PLUGIN_INFO = setPin: function(pin) { let self = this; this.getAccessToken(pin, function() { - liberator.echo("Twittperator: getting access token is success.", true); + Twittperator.echo("getting access token is success."); self.initialize(); }); }, @@ -1364,7 +1364,7 @@ let PLUGIN_INFO = favorite: function (id) { // {{{ tw.post("http://api.twitter.com/1/favorites/create/" + id + ".json", null, function(text) { let res = Util.fixStatusObject(JSON.parse(text)); - liberator.echo("[Twittperator] fav: " + res.user.name + " " + res.text, true); + Twittperator.echo("fav: " + res.user.name + " " + res.text) }); }, // }}} getFollowersStatus: function (target, force, onload) { // {{{ @@ -1417,20 +1417,20 @@ let PLUGIN_INFO = sendData.source = "Twittperator"; tw.post("http://api.twitter.com/1/statuses/update.json", sendData, function(text) { let t = Util.fixStatusObject(JSON.parse(text || "{}")).text; - liberator.echo("[Twittperator] Your post " + '"' + t + '" (' + t.length + " characters) was sent.", true); + Twittperator.echo("Your post " + '"' + t + '" (' + t.length + " characters) was sent."); }); }, // }}} reTweet: function (id) { // {{{ let url = "http://api.twitter.com/1/statuses/retweet/" + id + ".json"; tw.post(url, null, function(text) { let res = Util.fixStatusObject(JSON.parse(text)); - liberator.echo("[Twittperator] ReTweet: " + res.retweeted_status.text, true); + Twittperator.echo("ReTweet: " + res.retweeted_status.text); }); }, // }}} unfavorite: function (id) { // {{{ tw.post("http://api.twitter.com/1/favorites/destroy/" + id + ".json", null, function(text) { let res = Util.fixStatusObject(JSON.parse(text)); - liberator.echo("[Twittperator] unfav: " + res.user.name + " " + res.text, true); + Twittperator.echo("unfav: " + res.user.name + " " + res.text, true); }); }, // }}} }; // }}} @@ -1469,6 +1469,9 @@ let PLUGIN_INFO = }, // }}} }; // }}} let Twittperator = { // {{{ + echo: function (msg) { // {{{ + liberator.echo("[Twittperator] " + msg); + }, // }}} loadPlugins: function () { // {{{ function isEnabled(file) let (name = file.leafName.replace(/\..*/, "").replace(/-/g, "_")) @@ -1842,7 +1845,7 @@ let PLUGIN_INFO = tw.getRequestToken(function(url) { liberator.open(url, { where: liberator.NEW_TAB }); }); - liberator.echo("Twittperator", "Please get PIN code and execute\n :tw -setPIN {PINcode}"); + Twittperator.echo("Please get PIN code and execute\n :tw -setPIN {PINcode}"); } else if (args["-setPIN"]) { tw.setPin(args["-setPIN"]); } -- cgit v1.2.3