Skip to content

Instantly share code, notes, and snippets.

@joshuahhh
Created May 14, 2019 06:34
Show Gist options
  • Save joshuahhh/2a30e83d1780066d549bad82ee515a28 to your computer and use it in GitHub Desktop.
Save joshuahhh/2a30e83d1780066d549bad82ee515a28 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Latest Tweets Only
// @description Automatically switches from "Top Tweets" to "Lastest Tweets" (whenever Twitter switches you back).
// @match https://twitter.com/home
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function () {
const topTweetsOn = document.querySelector('[aria-label="Top Tweets on"]')
if (topTweetsOn) {
topTweetsOn.click()
setTimeout(function () {
const menuItems = document.querySelectorAll('[role="menuitem"]');
menuItems[0].click()
}, 100)
}
}, 400);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment