Last active
March 9, 2022 19:12
-
-
Save stefanschmidt/0c87931f366967b4ab1f4c08d36680e8 to your computer and use it in GitHub Desktop.
Batch re-crawl all Pinboard bookmarks that show an error 500 instead of a link to an archived copy
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
/* | |
1. Open https://pinboard.in/u:account/code:500 in browser | |
2. Maximize the number of displayed bookmarks per page (160) | |
3. Open the JavaScript Console in browser | |
4. Paste the below snippet to re-crawl all links with error 500 | |
5. Refresh browser and repeat as needed | |
*/ | |
const list = document.querySelectorAll('a[title="Click to re-crawl this link"]'); | |
const regexp = /mark_for_recrawl\(this, (\d+), '([0-9a-f]+)'\);return false;/g; | |
var str | |
var matches | |
for (let i = 0; i < list.length; i++) { | |
str = list[i].outerHTML | |
matches = [...str.matchAll(regexp)]; | |
mark_for_recrawl(list[i], parseInt(matches[0][1], 10), matches[0][2].toString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment