Skip to content

Instantly share code, notes, and snippets.

@andy0130tw
Created May 11, 2025 14:06
Show Gist options
  • Save andy0130tw/31c1267ba2c5db7f98bbb49443e1c547 to your computer and use it in GitHub Desktop.
Save andy0130tw/31c1267ba2c5db7f98bbb49443e1c547 to your computer and use it in GitHub Desktop.
yorkxin blog link replacer
// ==UserScript==
// @name yorkxin
// @version 1
// @match https://blog.yorkxin.org/*
// @grant none
// ==/UserScript==
const links = Array.from(document.querySelectorAll('a[href]'))
let cnt = 0
links.forEach(x => {
const rep = x.href.replace(/2013\/09\/30\//, '')
if (rep != x.href) {
x.href = rep
cnt++
}
})
console.log(`${cnt} links are replaced`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment