diff options
author | anekos | 2010-07-31 10:05:55 +0000 |
---|---|---|
committer | anekos | 2010-07-31 10:05:55 +0000 |
commit | 1ac395dc8435ff245e1c82c3148ef504255f73c0 (patch) | |
tree | beba9b47155087aabd8bc14cfe401238838a19e7 /twittperator.js | |
parent | c8ab80046950d97dabf196d5eaac0c2d1753358a (diff) | |
download | vimperator-plugins-1ac395dc8435ff245e1c82c3148ef504255f73c0.tar.bz2 |
構造変更
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38082 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'twittperator.js')
-rwxr-xr-x | twittperator.js | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/twittperator.js b/twittperator.js index f21c34c..bb96c1e 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1068,6 +1068,7 @@ })(); // }}} + // Twittperator // ChirpUserStream // {{{ // XXX if (0) の部分は認証に対するテストコード let ChirpUserStream = (function() { @@ -1195,8 +1196,6 @@ stop: stop }; })(); // }}} - - // Twittperator function xmlhttpRequest(options) { // {{{ let xhr = new XMLHttpRequest(); xhr.open(options.method, options.url, true); @@ -1207,33 +1206,6 @@ } xhr.send(null); } // }}} - - // Variables {{{ - let setting = { - useChirp: liberator.globalVariables.twittperator_use_chirp - }; - - let accessor = storage.newMap("twittperator", { store: true }); - accessor.set("clientName", "Twittperator"); - accessor.set("consumerKey", "GQWob4E5tCHVQnEVPvmorQ"); - accessor.set("consumerSecret", "gVwj45GaW6Sp7gdua6UFyiF910ffIety0sD1dv36Cz8"); - - let history; - if (__context__.hasOwnProperty('history')) { - history = __context__.history; - liberator.registerObserver('exit', function () accessor.set("history", history)); - } else { - history = __context__.history = accessor.get("history", []); - } - - let tw = new TwitterOauth(accessor); - - let expiredStatus = true; - let autoStatusUpdate = !!parseInt(liberator.globalVariables.twittperator_auto_status_update || 0); - let statusValidDuration = parseInt(liberator.globalVariables.twitperator_status_valid_duration || 90); - let statusRefreshTimer; - // }}} - function showTL(s) { // {{{ function unescapeBrakets(str) str.replace(/</g, "<").replace(/>/g, ">"); @@ -1327,9 +1299,8 @@ showTL(statuses); }); } // }}} - - // XXX 引数には何の意味が? function showTwitterMentions(arg) { // {{{ + // XXX 引数には何の意味が? if (/^@/.test(arg)) arg = arg.substr(1); tw.get("http://api.twitter.com/1/statuses/mentions.json", null, function(text) { @@ -1513,6 +1484,32 @@ }, true); } // }}} + // Initialization {{{ + let setting = { + useChirp: liberator.globalVariables.twittperator_use_chirp + }; + + let accessor = storage.newMap("twittperator", { store: true }); + accessor.set("clientName", "Twittperator"); + accessor.set("consumerKey", "GQWob4E5tCHVQnEVPvmorQ"); + accessor.set("consumerSecret", "gVwj45GaW6Sp7gdua6UFyiF910ffIety0sD1dv36Cz8"); + + let history; + if (__context__.hasOwnProperty('history')) { + history = __context__.history; + liberator.registerObserver('exit', function () accessor.set("history", history)); + } else { + history = __context__.history = accessor.get("history", []); + } + + let tw = new TwitterOauth(accessor); + + let expiredStatus = true; + let autoStatusUpdate = !!parseInt(liberator.globalVariables.twittperator_auto_status_update || 0); + let statusValidDuration = parseInt(liberator.globalVariables.twitperator_status_valid_duration || 90); + let statusRefreshTimer; + // }}} + })(); // vim: sw=2 ts=2 et fdm=marker: |