Skip to content

Instantly share code, notes, and snippets.

@ivancuric
Created October 11, 2017 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivancuric/b0391c19e6f01db3e07e6ba9eb8c91b7 to your computer and use it in GitHub Desktop.
Save ivancuric/b0391c19e6f01db3e07e6ba9eb8c91b7 to your computer and use it in GitHub Desktop.
(() => {
const sindreList = [
'#alternativefact',
'#alternativefacts',
'@realdonaldtrump',
'attorney general',
'bomb',
'bombs',
'brexit',
'climate change',
'comey',
'congress',
'conspiracy',
'constitutional',
'conway',
'corbyn',
'court order',
'david duke',
'detention',
'diplomat',
'diplomatic',
'election',
'fbi',
'federal agencies',
'federal agency',
'feminism',
'feminist',
'government',
'governments',
'handcuffs',
'hate',
'hatred',
'immigration',
'inauguration',
'isis',
'ivanka',
'legislation',
'nazi',
'nazis',
'obama',
'parliament',
'pentagon',
'political',
'politician',
'politicians',
'politics',
'president',
'pride',
'protest',
'protesting',
'protestor',
'protestors',
'protests',
'putin',
'religion',
'religious',
'republican',
'republicans',
'sean spicer',
'senate',
'senator',
'senators',
'sjw',
'steve bannon',
'supreme court',
'supremacy',
'supremacist',
'tax dollars',
'taxes',
'terrorist',
'terrorists',
'trump',
'war',
'white house',
'football',
'soccer',
'fake news',
'#flatearth',
'flat earth',
'kardashian',
'snapchat',
'stock market',
'uber'
];
const myList = [
'straight men',
'straight man',
'diversity',
'Theresa May',
'POTUS',
'white privilege',
"US President's",
'US President',
'Democrat',
'Republican',
'tony blair',
'football',
'neo-Nazi',
'Tory',
'underrepresented',
'women in tech',
'Pence',
'Liberals',
'Conservatives',
'sexist',
'sexism',
'president',
'feminist',
'wage gap',
'white man',
'white male',
'non-binary',
'sexual',
'gender equality',
"Trump's",
'freedom of speech',
'catholic',
'muslim',
'christian',
'democratic',
'Fox news',
'BBC',
'rightwing',
'right-wing',
'right wing',
'brexiters',
'iraq',
'afghanistan',
'voters',
'nazi',
'alt-right',
'terrorism',
'military',
'police',
'religion',
'#FakeNews',
'trumpcare',
'obamacare',
'healthcare',
'republicans',
'Democrats',
'mansplain',
'NSA',
'pentagon',
'brexodus',
'nationals',
'brexit',
'electorate',
'trump',
'tories',
'stock market',
'fake news',
'senate',
'obama',
'legislation',
'isis',
'immigration',
'government',
'fbi',
'conspiracy',
'congress',
'@realdonaldtrump',
'alternativefact',
'#alternativefact',
'#alternativefacts',
'@realdonaldtrump',
'attorney general',
'bomb',
'bombs',
'brexit',
'climate change',
'comey',
'congress',
'conspiracy',
'constitutional',
'conway',
'corbyn',
'court order',
'david duke',
'detention',
'diplomat',
'diplomatic',
'election',
'fbi',
'federal agencies',
'federal agency',
'feminism',
'feminist',
'government',
'governments',
'handcuffs',
'hate',
'hatred',
'immigration',
'inauguration',
'isis',
'ivanka',
'legislation',
'nazi',
'nazis',
'obama',
'parliament',
'pentagon',
'political',
'politician',
'politicians',
'politics',
'president',
'pride',
'protest',
'protesting',
'protestor',
'protestors',
'protests',
'putin',
'religion',
'religious',
'republican',
'republicans',
'sean spicer',
'senate',
'senator',
'senators',
'sjw',
'steve bannon',
'supreme court',
'supremacy',
'supremacist',
'tax dollars',
'taxes',
'terrorist',
'terrorists',
'trump',
'war',
'white house'
];
const sorted = Array.from(new Set([...sindreList, ...myList])).sort();
const clickEvt = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
});
const delay = ms => new Promise(r => setTimeout(r, ms));
const loop = async () => {
for (let i = 0; i < sorted.length; i++) {
await delay(500);
document
.querySelector('.MutedKeywordsActions-openDialogButton')
.dispatchEvent(clickEvt);
await delay(500);
const input = document.querySelector(
'.MutedKeywordsAddItemForm-input .rich-editor'
);
input.dispatchEvent(clickEvt);
input.click();
input.focus();
input.innerHTML = sorted[i];
input.dispatchEvent(new KeyboardEvent('keydown', {
key: 'Space'
}));
input.dispatchEvent(new Event('compositionend', {}));
await delay(150);
const add = document.querySelector('.MutedKeywordsAddItemForm-button');
add.removeAttribute('disabled');
add.dispatchEvent(clickEvt);
}
};
loop();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment