Created
May 11, 2025 14:06
-
-
Save andy0130tw/31c1267ba2c5db7f98bbb49443e1c547 to your computer and use it in GitHub Desktop.
yorkxin blog link replacer
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
// ==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