aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2010-09-22 00:33:19 +0000
committeranekos2010-09-22 00:33:19 +0000
commit68fc26491d582364df8f3546ebebda49088b67cd (patch)
tree53426a8c51b433603ee6e7f6e5a88164f5150bf4
parent13c832a1cb3843654c8d701308bdf2adf642d31b (diff)
downloadvimperator-plugins-68fc26491d582364df8f3546ebebda49088b67cd.tar.bz2
say を分割
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38509 d0d07461-0603-4401-acd4-de1884942a52
-rwxr-xr-xtwittperator.js62
1 files changed, 32 insertions, 30 deletions
diff --git a/twittperator.js b/twittperator.js
index 65bbee7..52f9107 100755
--- a/twittperator.js
+++ b/twittperator.js
@@ -1454,35 +1454,14 @@ let PLUGIN_INFO =
});
}
}, // }}}
- say: function(stat) { // {{{
- let sendData = {};
- let prefix, replyUser, replyID, postfix;
- if (stat.match(/^(.*)@(\w{1,15})#(\d+)(.*)$/)) {
- [prefix, replyUser, replyID, postfix] = [RegExp.$1, RegExp.$2, RegExp.$3, RegExp.$4];
- if (stat.indexOf("RT @" + replyUser + "#" + replyID) == 0) {
- Twittperator.withProtectedUserConfirmation(
- { screenName: replyUser, statusId: replyID },
- "retweet",
- function() Twitter.retweet(replyID)
- );
- return;
- }
- stat = prefix + "@" + replyUser + postfix;
- if (replyID && !prefix)
- sendData.in_reply_to_status_id = replyID;
- }
- Twittperator.withProtectedUserConfirmation(
- { screenName: replyUser, statusId: replyID },
- "reply",
- function() {
- sendData.status = stat;
- sendData.source = "Twittperator";
- tw.post("statuses/update.json", sendData, function(text) {
- let t = Utils.fixStatusObject(JSON.parse(text || "{}")).text;
- Twittperator.echo("Your post " + '"' + t + '" (' + t.length + " characters) was sent.");
- });
- }
- );
+ say: function(status, inReplyToStatusId) { // {{{
+ let sendData = {status: status, source: "Twittperator"};
+ if (inReplyToStatusId)
+ sendData.in_reply_to_status_id = inReplyToStatusId;
+ tw.post("statuses/update.json", sendData, function(text) {
+ let t = Utils.fixStatusObject(JSON.parse(text || "{}")).text;
+ Twittperator.echo("Your post " + '"' + t + '" (' + t.length + " characters) was sent.");
+ });
}, // }}}
retweet: function(id) { // {{{
let url = "statuses/retweet/" + id + ".json";
@@ -1603,6 +1582,29 @@ let PLUGIN_INFO =
map(function(ss) (ss.reverse(), ss.map(String.trim)))
Twittperator.selectAndOpenLink(links);
}, // }}}
+ say: function(stat) { // {{{
+ let sendData = {};
+ let prefix, replyUser, replyID, postfix;
+ if (stat.match(/^(.*)@(\w{1,15})#(\d+)(.*)$/)) {
+ [prefix, replyUser, replyID, postfix] = [RegExp.$1, RegExp.$2, RegExp.$3, RegExp.$4];
+ if (stat.indexOf("RT @" + replyUser + "#" + replyID) == 0) {
+ Twittperator.withProtectedUserConfirmation(
+ { screenName: replyUser, statusId: replyID },
+ "retweet",
+ function() Twitter.retweet(replyID)
+ );
+ return;
+ }
+ stat = prefix + "@" + replyUser + postfix;
+ if (replyID && !prefix)
+ sendData.in_reply_to_status_id = replyID;
+ }
+ Twittperator.withProtectedUserConfirmation(
+ { screenName: replyUser, statusId: replyID },
+ "reply",
+ function() Twitter.say(stat, replyID)
+ );
+ }, // }}}
selectAndOpenLink: function(links) { // {{{
if (!links || !links.length)
return;
@@ -2000,7 +2002,7 @@ let PLUGIN_INFO =
if (arg.length === 0)
Twittperator.showFollowersStatus();
else
- Twitter.say(arg);
+ Twittperator.say(arg);
}
}, {
bang: true,