Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TwitterLiveFeed
///<reference types="typed-query-selector"/>
///<reference types="typed-query-selector/parser"/>
///<reference path="./xpath-text-search.d.ts"/>
///<reference types="mousetrap"/>
// ==UserScript==
// @name TwitterLiveFeed
// @author disk0
// @description Force Twitter feed to display latest tweets
// @version 0.2.1
// @run-at document-idle
// @namespace disc0/github/TwitterLiveFeed
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAEHWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS41LWMwMTEgNzkuMTQ5NTk4LCAyMDEyLzEwLzEwLTEyOjA5OjU2ICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6bnMxPSJodHRwOi8vd3d3LmRheS5jb20vZGFtLzEuMCIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICBuczE6UGh5c2ljYWxoZWlnaHRpbmluY2hlcz0iLTEuMCIKICAgbnMxOlBoeXNpY2Fsd2lkdGhpbmluY2hlcz0iLTEuMCIKICAgbnMxOkZpbGVmb3JtYXQ9IlBORyIKICAgbnMxOlByb2dyZXNzaXZlPSJubyIKICAgbnMxOmV4dHJhY3RlZD0iMjAxNy0xMS0xOVQwMzozMDoyMy4wODJaIgogICB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CwA/6DZayf3LESAsNTR6OTTeFu5z3lbRbRyk8LhWCgQIy+g0BkKjE2KeI4asSqVAgDBvaEwCIx7di6MbXKKLAKFyWPSmgmK3sC9V10S3EUNWI6VAgPBSWERI9HNYbOfHvsp01sfcebjKCgHSwA/0WDMRHcD/zv7mPRPMcxWTMJh8/dtUSAgKdB0IkBYFSHyox8aCs0xOjx6FA+g6ECCCxA2VWLm4wupI14EAaWeIuEcGqxCdxrkrrBAg3QiSfjH7sBa85LIYD1eVSoEA6VaQDHI3MlANKhrl4BgpBQKk20EyLGyLzmzKHByXSoEAQZAgOBAgCBIEBwgQQYLgAAHSkiCJmzkNVENwgABhniCJAImbO7n8t31GhauqECCsIUj6OUiiM+mpSGPFAsDrwjoOBAgbCpMIEcNbzRJbjpxHeNivCgFCXbqSSZj0VaR2ytxtnOs2ECDUOUwGOUhirsQQ1+ZMhqg+u/84CJAmhkmEyFthIjRAgLBoZzIJk76KLE05FRoj5QAB0vYw6ecgmdwjXXdSrcuIoPhSjCfCSyUBAdLlQNnJQSJQXg6MUQqMWyUBAcLLgbKTA2XydVdEWERIfMuBocMAAcKCoRKdST8d21Oh0uROJUKizEERX98KCxAgrD9YejlQfpsKlk13LWU+7nJI3E1CQ1CAAKEZATPdqfSLn68A+72Y/aqwCIC/nwmKcGeOAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmuy/AgwAkfRw6ie3iqkAAAAASUVORK5CYII=
// @match https://*.twitter.com/*
// @match https://twitter.com/*
// @grant GM_info
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
// Simple
//(()=>{let d=document,qs=(s,o=d)=>o.querySelector(s);[qs(`[aria-label="Top Tweets on"]`)].forEach(_=>{_.click();qs(`[role="menu"] [role="menuitem"]`).click();})})()
// Overkill
(async () => {
function isHTMLElement(obj) { return (!!obj) && obj instanceof HTMLElement; }
//#region Log
class StyledLog {
headerText;
headerArgs = [];
get headerSpread() { return [this.headerText, ...this.headerArgs]; }
get header() { return { text: this.headerText, args: this.headerArgs }; }
constructor(headerText = '', ...headerArgs) {
this.headerText = headerText;
Object.assign(this, { headerArgs });
}
info = (...msg) => console.info(...(msg.length === 0)
? this.headerSpread :
(typeof msg[0] === 'string')
? [`${this.header.text} ${msg[0]}`, ...this.header.args, ...(msg.length > 1) ? msg.slice(1) : []]
: [...this.headerSpread, ...msg]);
log = (...msg) => console.log(...(msg.length === 0)
? this.headerSpread :
(typeof msg[0] === 'string')
? [`${this.header.text} ${msg[0]}`, ...this.header.args, ...(msg.length > 1) ? msg.slice(1) : []]
: [...this.headerSpread, ...msg]);
debug = (...msg) => console.debug(...(msg.length === 0)
? this.headerSpread :
(typeof msg[0] === 'string')
? [`${this.header.text} ${msg[0]}`, ...this.header.args, ...(msg.length > 1) ? msg.slice(1) : []]
: [...this.headerSpread, ...msg]);
warn = (...msg) => console.warn(...(msg.length === 0)
? this.headerSpread :
(typeof msg[0] === 'string')
? [`${this.header.text} ${msg[0]}`, ...this.header.args, ...(msg.length > 1) ? msg.slice(1) : []]
: [...this.headerSpread, ...msg]);
}
const log = new StyledLog(`%c[TwitterLiveFeed]%c`, `background: #44AAFF; color: white; padding: 0.2em 0.25em; margin-bottom: 0.15em; border-radius: 0.15em;`, '');
function consoleGroupScope(...args) {
let fn, name;
if (typeof args[0] === 'string') {
[name, fn] = args;
}
else {
[fn, name = ""] = args;
}
try {
console.group(name);
fn();
}
catch (error) {
console.warn(`Caught in console group wrapper: ${error}`);
}
finally {
console.groupEnd();
}
}
//#region Userscript Info
class Script {
static namespace = "TwitterUtil";
static settingsname = "TwitterUtil";
//#region GM Value Controls
static AutoFixDisabledValueKey = 'autofix-disabled';
static get AutoFixDisabledState() {
return GM_getValue(Script.AutoFixDisabledValueKey, false);
}
static ToggleDisableLiveFeedUpdate() {
log.debug(`Toggling automatic fixes`);
GM_setValue(Script.AutoFixDisabledValueKey, !Script.AutoFixDisabledState);
log.info(`Redrawing menu`);
Script.GM_Menubar_AutoFixState.update();
}
static FixTotalValueKey = 'autofix-total';
static get FixTotal() {
// No value returned implies no past changes
return ((value = 0) => {
// Idiot check
if (Number.isInteger(value))
return value;
// Write warning if invalid
log.warn(`Read invalid value from storage (value: ${typeof value} => ${String(value)})`);
return 0;
})(GM_getValue(Script.FixTotalValueKey, 0));
}
static IncrementFixTotal() {
const value = Script.FixTotal + 1;
GM_setValue(Script.FixTotalValueKey, value);
log.info(`Total timeline adjustments: ${value}`);
log.info(`Redrawing menu`);
Script.GM_Menubar_FixTotalView.update();
}
//#endregion GM Value Controls
//#region GM Menubar Items
static GM_Menubar_AutoFixState = new class {
menuItemId;
constructor() {
this.menuItemId = this.update();
}
update() {
// Remove existing display on repeat updates
if (typeof this.menuItemId === 'number')
GM_unregisterMenuCommand(this.menuItemId);
this.menuItemId = GM_registerMenuCommand((Script.AutoFixDisabledState
? `Disabled`
: `Enabled`), () => log.debug(`Info menu item no-op`));
return this.menuItemId;
}
};
static GM_Menubar_ToggleAutoFixState = new class {
menuItemId = GM_registerMenuCommand('Toggle automatic feed fixes', () => Script.ToggleDisableLiveFeedUpdate());
};
//#endregion GM Menubar Items
static GM_Menubar_FixTotalView = new class {
menuItemId;
constructor() {
this.menuItemId = this.update();
}
update() {
// Remove existing display on repeat updates
if (typeof this.menuItemId === 'number')
GM_unregisterMenuCommand(this.menuItemId);
this.menuItemId = GM_registerMenuCommand(`Total Feed Fixes: ${Script.FixTotal}`, () => log.debug(`Info menu item no-op`));
return this.menuItemId;
}
};
static async run() {
// var menuHide = GM_registerMenuCommand( 'Force Twitter Live Feed',
// Main.toggleForceliveFeed );
// consoleGroupScope('TwitterLiveFeed', async () => { await checkPage() })
checkPage();
}
}
//#endregion Userscript Info
const checkPage = async () => {
// Element selectors used to target/navigate page
const headerSel = `[data-testid="primaryColumn"] h2[aria-level="2"][role="heading"]`;
const menuSel = `div[aria-label="Top Tweets on"]`;
const buttonSel = `#layers [role="menu"] div[role="menuitem"]`;
// Store clicked state to avoid phantom second click
let clicked = false;
const clickLog = (...args) => {
const msg = typeof args[0] === 'string'
? args[0]
: 'Clicking element:';
const el = args.slice(-1)[0];
log.log(`${msg}\n%o`, el);
el.click();
};
const clickTimelineButton = async (el) => {
if (clicked) {
log.info(`Skipping clicking timeline menu button, clicked state has already been set.`);
return;
}
try {
clickLog(`Clicking timeline menu button:`, el);
clicked = true;
Script.IncrementFixTotal();
}
catch (error) {
log.warn(`Error clicking timeline menu button element:\n%o`, error);
}
finally {
try {
const buttonEl = await waitSelector(buttonSel);
if (!buttonEl) {
log.warn(`Timeline update button not found`);
return;
}
clickLog(`Clicking latest tweets view button:`, buttonEl);
}
catch (error) {
log.warn(`Latest tweets view apply button not found. Error:\n%o`, error);
}
}
};
const waitSelector = function (selector, timeout = 2000) {
return new Promise((resolve, reject) => {
const startTimeout = () => setTimeout(() => reject(), timeout);
if (typeof selector === 'undefined')
startTimeout();
const waitForElement = function () {
const element = document.querySelector(selector);
if (element)
resolve(element);
else
window.requestAnimationFrame(waitForElement);
};
startTimeout();
waitForElement();
});
};
const updateTimeline = async (headerEl = document.querySelector(headerSel)) => {
log.debug(`Heading Element:\n`, headerEl);
if (headerEl.textContent !== `Latest Tweets`) {
try {
const timelineButtonEl = await waitSelector(menuSel);
if (!timelineButtonEl) {
log.warn(`No value received from waitSelector for timeline element.`);
return;
}
else if (!isHTMLElement(timelineButtonEl)) {
log.warn(`Returned timeline element value is not an HTMLElement instance.`);
return;
}
else
clickTimelineButton(timelineButtonEl);
}
catch (error) {
log.warn(`Error thrown while searching for timeline button: ${error}`);
return;
}
}
else {
log.debug(`Already viewing latest tweets`);
return;
}
};
try {
log.debug(`Waiting to check for header selector`);
const headerEl = await waitSelector(headerSel);
if (!headerEl)
return;
await updateTimeline(headerEl);
}
catch (error) {
log.warn(`Error thrown, timeline header element not found:\n%o`, error);
}
};
await Script.run();
})();
//# sourceMappingURL=TwitterLiveFeed.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment