aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2010-08-15 05:52:59 +0000
committeranekos2010-08-15 05:52:59 +0000
commit914dcbc352bfa480467ddf15b9a860edf03eecb1 (patch)
treef95bf735a97d91f30b478f98b48e86d49c0bdcf5
parentfd3496695cf5507780188bbebeddb761c43eff60 (diff)
downloadvimperator-plugins-914dcbc352bfa480467ddf15b9a860edf03eecb1.tar.bz2
echo のフォーマットを統一するためにまとめる
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38273 d0d07461-0603-4401-acd4-de1884942a52
-rwxr-xr-xtwittperator.js15
1 files changed, 9 insertions, 6 deletions
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"]);
}