From f22c733ec1aa6187245abaf3604bf5884e9476a8 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 17 Aug 2010 11:59:04 +0000 Subject: 残念な事情により名称変更 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38293 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/twittperator.js b/twittperator.js index f26e357..a5ab41c 100755 --- a/twittperator.js +++ b/twittperator.js @@ -28,7 +28,7 @@ let PLUGIN_INFO = twittperator Twitter Client using ChirpStream OAuth対応Twitterクライアント - 1.1.3 + 1.1.4 2.3 2.4 teramako @@ -1017,7 +1017,7 @@ let PLUGIN_INFO = } }, }; - Util.xmlhttpRequest(options); + Utils.xmlhttpRequest(options); }, setPin: function(pin) { @@ -1064,7 +1064,7 @@ let PLUGIN_INFO = }, }; - Util.xmlhttpRequest(options); // 送信 + Utils.xmlhttpRequest(options); // 送信 }, // api+?+query にアクセスした結果をcallbackに渡す get: function(api, query, callback) { @@ -1094,7 +1094,7 @@ let PLUGIN_INFO = } }, }; - Util.xmlhttpRequest(options); // 送信 + Utils.xmlhttpRequest(options); // 送信 }, post: function(api, content, callback) { var message = { @@ -1127,7 +1127,7 @@ let PLUGIN_INFO = } } }; - Util.xmlhttpRequest(options); // 送信 + Utils.xmlhttpRequest(options); // 送信 }, getAuthorizationHeader: function(api) { var message = { @@ -1313,7 +1313,7 @@ let PLUGIN_INFO = for (let [, line] in Iterator(lines.slice(0, -1))) { try { if (/^\s*\{/(line)) - onMsg(Util.fixStatusObject(JSON.parse(line)), line); + onMsg(Utils.fixStatusObject(JSON.parse(line)), line); } catch (e) { liberator.log(e); } } buf = lines.slice(-1)[0]; @@ -1363,7 +1363,7 @@ let PLUGIN_INFO = let Twitter = { // {{{ favorite: function (id) { // {{{ tw.post("http://api.twitter.com/1/favorites/create/" + id + ".json", null, function(text) { - let res = Util.fixStatusObject(JSON.parse(text)); + let res = Utils.fixStatusObject(JSON.parse(text)); Twittperator.echo("fav: " + res.user.name + " " + res.text) }); }, // }}} @@ -1394,7 +1394,7 @@ let PLUGIN_INFO = tw.get(api, query, function(text) { setRefresher(); // TODO 履歴をちゃんと "追記" するようにするようにするべき - let result = JSON.parse(text).map(Util.fixStatusObject); + let result = JSON.parse(text).map(Utils.fixStatusObject); if (!target) history = result; onload(result); @@ -1416,32 +1416,32 @@ let PLUGIN_INFO = sendData.status = stat; sendData.source = "Twittperator"; tw.post("http://api.twitter.com/1/statuses/update.json", sendData, function(text) { - let t = Util.fixStatusObject(JSON.parse(text || "{}")).text; + let t = Utils.fixStatusObject(JSON.parse(text || "{}")).text; 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)); + let res = Utils.fixStatusObject(JSON.parse(text)); 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)); + let res = Utils.fixStatusObject(JSON.parse(text)); Twittperator.echo("unfav: " + res.user.name + " " + res.text, true); }); }, // }}} }; // }}} - let Util = { // {{{ + let Utils = { // {{{ anchorLink: function (str) { // {{{ let m = str.match(/https?:\/\/\S+/); if (m) { let left = str.substr(0, m.index); let url = m[0]; let right = str.substring(m.index + m[0].length); - return <>{Util.anchorLink(left)} {url} {Util.anchorLink(right)}; + return <>{Utils.anchorLink(left)} {url} {Utils.anchorLink(right)}; } return str; }, // }}} @@ -1451,7 +1451,7 @@ let PLUGIN_INFO = let result = {}; for (let [n, v] in Iterator(st)) { - result[n] = v && typeof v === 'object' ? Util.fixStatusObject(v) : + result[n] = v && typeof v === 'object' ? Utils.fixStatusObject(v) : n === 'text' ? unescapeAmps(v) : v; } @@ -1549,7 +1549,7 @@ let PLUGIN_INFO = {status.user.screen_name} - {Util.anchorLink(rt.text)} + {Utils.anchorLink(rt.text)} : @@ -1559,7 +1559,7 @@ let PLUGIN_INFO = {status.user.screen_name}‬ - {Util.anchorLink(status.text)} + {Utils.anchorLink(status.text)} ); @@ -1572,7 +1572,7 @@ let PLUGIN_INFO = }, // }}} showTwitterMentions: function (arg) { // {{{ tw.get("http://api.twitter.com/1/statuses/mentions.json", null, function(text) { - Twittperator.showTL(JSON.parse(text).map(Util.fixStatusObject)); + Twittperator.showTL(JSON.parse(text).map(Utils.fixStatusObject)); }); }, // }}} showTwitterSearchResult: function (word) { // {{{ @@ -1591,7 +1591,7 @@ let PLUGIN_INFO = tw.get("http://search.twitter.com/search.json", { q: word }, function(text) { let results = JSON.parse(text).results; if (results.length > 0) { - Twittperator.showTL(results.map(Util.fixStatusObject).map(konbuArt)); + Twittperator.showTL(results.map(Utils.fixStatusObject).map(konbuArt)); } else { Twittperator.echo("No results found.") } @@ -1893,6 +1893,7 @@ let PLUGIN_INFO = __context__.OAuth = tw; __context__.ChirpUserStream = ChirpUserStream; __context__.Twittperator = Twittperator; + __context__.Utils = Utils; Twittperator.loadPlugins(); -- cgit v1.2.3