Skip to content

Instantly share code, notes, and snippets.

@pqrth
Created March 8, 2023 08:35
Show Gist options
  • Save pqrth/b3937ffd516d2626fff34dd15593b9cd to your computer and use it in GitHub Desktop.
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)
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