Skip to content

Instantly share code, notes, and snippets.

@azu
Created March 17, 2009 06:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save azu/80361 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Auto-reload Twitter
// @namespace http://chris4403.blogspot.com/userscripts
// @description Add "Translate!" link and language select pulldown to twitter timeline.Translate feature is using Google AJAX Language API.
// @include http://twitter.com/*
// @include https://twitter.com/*
// @include http://twitter.com/account/archive
// @include https://twitter.com/account/archive
// @exclude http://twitter.com/account/setting
// @exclude https://twitter.com/account/setting
// @exclude http://twitter.com/
// @exclude https://twitter.com/
// @exclude http://twitter.com/*/statuses/*
// @exclude https://twitter.com/*/statuses/*
// @exclude http://twitter.com/*status*
// @exclude https://twitter.com/*status*
// ==/UserScript==
(function(){
var reloadFunc = function(){
window.location.href = window.location.href;
}
reloadFunc.timerId = setTimeout(reloadFunc,60000);
var s = document.getElementById('status');
if(s){
s.addEventListener('click', function(){
clearTimeout(reloadFunc.timerId);
}, false);
s.addEventListener('mouseover', function(){
clearTimeout(reloadFunc.timerId);
}, false);
s.addEventListener('blur', function(){
reloadFunc.timerId = setTimeout(reloadFunc,60000);
}, false);
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment