Last active
September 18, 2023 15:44
-
-
Save rezaerami/60ed665718845b61b84d651104daef27 to your computer and use it in GitHub Desktop.
Twitter auto report and blocker
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
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
(async () => { | |
document.querySelector('[data-testid="userActions"]').click(); | |
await sleep(100); | |
const reportOption = Array.from(document.querySelector('[data-testid="Dropdown"]').children).find(child => child.textContent.includes("Report")); | |
reportOption.click(); | |
await sleep(1000); | |
document.querySelector('[data-testid="OCF_CallToAction_Button"]').click(); | |
await sleep(1000); | |
Array.from(document.querySelectorAll('span')).find(element => element.textContent.includes("Someone else or a specific group of people")).click(); | |
await sleep(100); | |
document.querySelector('[data-testid="ChoiceSelectionNextButton"]').click(); | |
await sleep(1000); | |
Array.from(document.querySelectorAll('span')).find(element => element.textContent.includes("Harassed or intimidated with violence")).click(); | |
await sleep(100); | |
document.querySelector('[data-testid="ChoiceSelectionNextButton"]').click(); | |
await sleep(1000); | |
Array.from(document.querySelectorAll('span')).find(element => element.textContent.includes("Wishing harm on them")).click(); | |
await sleep(100); | |
document.querySelector('[data-testid="ChoiceSelectionNextButton"]').click(); | |
await sleep(1000); | |
const radioGroup = Array.from(document.querySelectorAll('input[type="checkbox"]')); | |
for (const radio of radioGroup) { | |
radio.click(); | |
await sleep(100); | |
} | |
document.querySelector('[data-testid="ChoiceSelectionNextButton"]').click(); | |
await sleep(1000); | |
Array.from(document.querySelectorAll('input[type="radio"]'))[0].click(); | |
await sleep(100); | |
document.querySelector('[data-testid="ChoiceSelectionNextButton"]').click(); | |
await sleep(1000); | |
document.querySelector('[data-testid="ocfSettingsListNextButton"]').click(); | |
await sleep(1000); | |
document.querySelector('[data-testid="ocfSettingsListNextButton"]').click(); | |
await sleep(1000); | |
Array.from(document.querySelectorAll('div[role="button"]')).find(element => element.textContent.includes("Block ")).click(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment