diff options
author | anekos | 2012-08-22 00:28:15 +0900 |
---|---|---|
committer | anekos | 2012-08-22 00:28:15 +0900 |
commit | 9b0249a0f687795caec587342e686300c6c7a39d (patch) | |
tree | 2f6102755ee0381f09fca6414cc1c2c9c6cba9b5 /twittperator.js | |
parent | 4d2bbb7f9303ee129d4444b65050cd2902635be0 (diff) | |
download | vimperator-plugins-9b0249a0f687795caec587342e686300c6c7a39d.tar.bz2 |
Add sub-command "tw!restartstreams" to twittperator
Diffstat (limited to 'twittperator.js')
-rw-r--r-- | twittperator.js | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/twittperator.js b/twittperator.js index 651afb0..42da2f2 100644 --- a/twittperator.js +++ b/twittperator.js @@ -26,7 +26,7 @@ // INFO {{{ let INFO = <> - <plugin name="Twittperator" version="1.18.0" + <plugin name="Twittperator" version="1.19.0" href="https://github.com/vimpr/vimperator-plugins/raw/master/twittperator.js" summary="Twitter Client using OAuth and Streaming API"> <author email="teramako@gmail.com" href="http://d.hatena.ne.jp/teramako/">teramako</author> @@ -175,7 +175,7 @@ let INFO = Write the plugin. </p> </plugin> - <plugin name="Twittperator" version="1.18.0" + <plugin name="Twittperator" version="1.19.0" href="https://github.com/vimpr/vimperator-plugins/raw/master/twittperator.js" lang="ja" summary="OAuth/StreamingAPI対応Twitterクライアント"> @@ -2475,6 +2475,11 @@ let INFO = description: "Find people with the words.", action: function(arg) Twittperator.showUsersSeachResult(arg), }), + SubCommand({ + command: ["restartstreams"], + description: "Restart streams", + action: function(arg) startStreams(), + }), ]; SubCommands.add = function(subCmd) { @@ -2675,6 +2680,19 @@ let INFO = let ChirpUserStream = Stream({ name: 'chirp stream', url: "https://userstream.twitter.com/2/user.json" }); let TrackingStream = Stream({ name: 'tracking stream', url: "https://stream.twitter.com/1/statuses/filter.json" }); + let startStreams = function () { + if (setting.useChirp){ + if(setting.allReplies) + ChirpUserStream.start({"replies":"all"}); + else + ChirpUserStream.start(); + } + + let trackWords = setting.trackWords || Store.get("trackWords"); + if (trackWords) + TrackingStream.start({track: trackWords}); + }; + // 公開オブジェクト __context__.OAuth = tw; __context__.ChirpUserStream = ChirpUserStream; @@ -2689,20 +2707,7 @@ let INFO = Twittperator.loadPlugins(); - liberator.registerObserver( - 'enter', - function () { - if (setting.useChirp){ - if(setting.allReplies) - ChirpUserStream.start({"replies":"all"}); - else - ChirpUserStream.start(); - } - - let trackWords = setting.trackWords || Store.get("trackWords"); - if (trackWords) - TrackingStream.start({track: trackWords}); - }); + liberator.registerObserver('enter', startStreams); __context__.onUnload = function() { Store.set("history", history); |