Created
September 3, 2015 10:07
-
-
Save broquaint/5861d1bd475dc4e4824a to your computer and use it in GitHub Desktop.
Unfavourite all favourited tweets currently on your favourites page
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
// Usage: | |
// 1. Go to https://twitter.com/favorites in a browser that supports ES6 | |
// 2. Open local equivalent of the JS console | |
// 3. Run this code. | |
function unfavourite(tweet) { | |
let $tweet = (sel) => jQuery(sel, tweet); | |
$tweet('.js-actionFavorite:visible').click(); | |
console.log( | |
"Unfavourited:\n", | |
$tweet('.tweet-text').text(), | |
"\nby ", $tweet('.username').text(), '[ ', $tweet('.js-permalink').text(), ' ]' | |
); | |
} | |
let tweets = document.querySelectorAll('#stream-items-id > li'); | |
let step = 0; | |
for(let tweet of Array.from(tweets).reverse()) { | |
setTimeout(unfavourite.bind(null, tweet), step++ * 500 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment