Last active
June 17, 2024 15:04
-
-
Save lac5/0605f29df9e4dcf2dd8608c13f87f231 to your computer and use it in GitHub Desktop.
Refreshes the timeline items automatically every 10 sec. (Original from <https://greasyfork.org/en/scripts/16553-twitter-auto-refresh/code?locale_override=1%27A%3D0%27>)
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 Twitter auto-refresh | |
// @namespace larryc5 | |
// @version 1.3 | |
// @description Refreshes the timeline items automatically every 10 sec. (Original from <https://greasyfork.org/en/scripts/16553-twitter-auto-refresh/code?locale_override=1%27A%3D0%27>) | |
// @author Larry Costigan | |
// @match https://twitter.com/* | |
// @grant none | |
// @downloadURL https://gist.github.com/larryc5/0605f29df9e4dcf2dd8608c13f87f231/raw/twitter-auto-refresh.user.js | |
// @updateURL https://gist.github.com/larryc5/0605f29df9e4dcf2dd8608c13f87f231/raw/twitter-auto-refresh.meta.js | |
// ==/UserScript== |
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 Twitter auto-refresh | |
// @namespace larryc5 | |
// @version 1.3 | |
// @description Refreshes the timeline items automatically every 10 sec. (Original from <https://greasyfork.org/en/scripts/16553-twitter-auto-refresh/code?locale_override=1%27A%3D0%27>) | |
// @author Larry Costigan | |
// @match https://twitter.com/* | |
// @grant none | |
// @downloadURL https://gist.github.com/larryc5/0605f29df9e4dcf2dd8608c13f87f231/raw/twitter-auto-refresh.user.js | |
// @updateURL https://gist.github.com/larryc5/0605f29df9e4dcf2dd8608c13f87f231/raw/twitter-auto-refresh.meta.js | |
// ==/UserScript== | |
(function(window) { | |
'use strict'; | |
var document = window.document; | |
var location = window.location; | |
setInterval(function() { | |
if (!document.hidden && /^\/+(?:home|[^\/]*\/lists\/[^\/]*)?\/*$/i.test(location.pathname) && window.scrollY <= 1) { // Get new tweets only when not seeing tweets down the timeline | |
var homeButton = document.querySelector('[href="/home"]'); | |
if (homeButton) { | |
homeButton.click(); | |
} | |
} | |
}, 10000); | |
}(window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment