Linux.do Forum Auto-Replace Domain with Tampermonkey

Preface

When posting on the Linux.do forum,
if the post contains links to external sites, the moderation requires that the linked external site page links back to the Linux.do forum.
if the post contains GitHub links, the moderation requires that the project's homepage README.md links to the Linux.do forum.

Idea

When posting, replace your own blog domain in the post body with Comply with Forum Guidelines. For example:

After the post is successfully published, when browsing the page, use a Tampermonkey script to replace Comply with Forum Guidelines with the user's website domain.

The final effect is

Github


Demo Effect

After installing the above Tampermonkey script, you can open this post to see the effect.

Development Process

At first, I figured since this was about developing a Tampermonkey script based on web pages, I used Antigravity.
But I ran into some issues. 
Antigravity occasionally said the model was busy and returned no results. 
I switched between different models, and finally managed to complete the first version by struggling along with Gemini-3-flash

My initial thought was to click the OP's avatar on the page, and in the pop-up floating box, find the website domain

The script content is relatively complex. It needs to implement a click, then wait for the popped-up floating box to display its content, and then extract the desired field.

After making the first version, I sent the script to the web version of ChatGPT and asked what could be improved?
I got some very good improvement suggestions.
Based on Discourse forum, if you want to get the user's information, you can visit  /u/{username}.json 
The final version of the script is clear and concise.

========
update
Added
G站 替换为 https://github.com


========

See Also


Comments