Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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