Skip to content

Instantly share code, notes, and snippets.

@VelizarHristov
Last active January 24, 2019 00:02
Show Gist options
  • Save VelizarHristov/16baad2e74fc78f8c82714095541139b to your computer and use it in GitHub Desktop.
Save VelizarHristov/16baad2e74fc78f8c82714095541139b to your computer and use it in GitHub Desktop.
Mark OKCupid questions as hidden
/**
Instructions:
1. Visit https://www.okcupid.com/questions
2. Open your browser's console
3. Paste the three lines below into the console
const jQuery = document.createElement('script');
jQuery.setAttribute('src','https://code.jquery.com/jquery-3.3.1.min.js');
document.head.appendChild(jQuery);
4. Paste the remaining code in your console
5. Scroll down until you can see all of your questions which you want to hide - the script does not scroll down for you
6. In your console, type clearTopQuestions(10000) -- it should take about 1 second per question.
I suspect it doesn't work while the tab is minimized.
You can stop it at any time, nothing bad will happen.
*/
async function clearTopQuestion() {
$(".profile-question-action--isAnswer:not(.profile-question-action--cantAnswer):first").click()
await new Promise(resolve => setTimeout(resolve, 300));
$(".oknf-switch-decoration").click()
await new Promise(resolve => setTimeout(resolve, 300));
$(".questionspage-buttons-button--answer").click()
await new Promise(resolve => setTimeout(resolve, 300));
}
async function clearTopQuestions(n) {
if (!n) {
return;
}
await clearTopQuestion();
return clearTopQuestions(n - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment