Created
March 8, 2023 08:35
-
-
Save pqrth/b3937ffd516d2626fff34dd15593b9cd to your computer and use it in GitHub Desktop.
Scrapy browser console script to unfollow all the podcasts on Overcast website (https://overcast.fm/podcasts)
This file contains 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 getPodcastIds() { | |
var feeds = document.querySelectorAll(".feedcell .art"), | |
i, ids = []; | |
for (i = 0; i < feeds.length; ++i) { | |
let anchorElement = document.createElement('a'); | |
anchorElement.href = feeds[i].src; | |
ids.push(anchorElement.pathname.split('/').pop().split('_')[0]); | |
} | |
return ids; | |
} | |
function unfollowPodcast(id) { | |
fetch("https://overcast.fm/podcasts/delete/" + id, { | |
"method": "POST", | |
"credentials": "include" | |
}); | |
} | |
function unfollowAllPodcasts(ids) { | |
var i; | |
for (i = 0; i < ids.length; ++i) { | |
unfollowPodcast(ids[i]); | |
} | |
} | |
unfollowAllPodcasts(getPodcastIds()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment