Created
November 25, 2009 13:33
-
-
Save azu/242701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name TwitterAutoReloader | |
| // @namespace http://hazisarashi.com/ | |
| // @description Twetterの差分更新を自動的に実行 | |
| // @include http://twitter.com/ | |
| // @include http://twitter.com/#/list/* | |
| // @include http://twitter.com/#list/* | |
| // @include http://twitter.com/#replies | |
| // @include https://twitter.com/ | |
| // @include https://twitter.com/#/list/* | |
| // @include https://twitter.com/#list/* | |
| // @include https://twitter.com/#replies | |
| // @include http://twitter.com/?sidebar | |
| // ==/UserScript== | |
| (function(){ | |
| function AutoReloader(){ | |
| var AutoReloaderInterval = setInterval(function(){ | |
| try{ | |
| if ( unsafeWindow.page.newResults && unsafeWindow.page.timelineRefresher && unsafeWindow.jQuery("#results_update").length == 1 ){ | |
| clearInterval(AutoReloaderInterval); | |
| unsafeWindow.page.timelineRefresher._run = unsafeWindow.page.timelineRefresher.run; | |
| unsafeWindow.page.timelineRefresher.run = function(){ | |
| this._run(); | |
| setTimeout ( function(){results_update_click();}, 1500 ); | |
| } | |
| unsafeWindow.jQuery("#results_update").click(); | |
| } | |
| }catch(errordebug){ | |
| console.debug('AutoReloaderError:'+errordebug); | |
| clearInterval(AutoReloaderInterval); | |
| AutoReloader(); | |
| } | |
| }, 10000 ); | |
| } | |
| AutoReloader(); | |
| function results_update_click(){ | |
| if ( unsafeWindow.jQuery("#results_update").length == 1 ){ | |
| unsafeWindow.jQuery("#results_update").click(); | |
| }else{ | |
| setTimeout ( function(){results_update_click();}, 500); | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment