I recently got fed up with seeing posts that look like spam, either because they don’t make sense or appear to be copy-pasted from an LLM. While they don’t initially contain any obvious spam links, those links often turn up in sneaky places, like embedded in commas or periods.
To help identify these more easily, I created a PowerShell script that checks a Discourse topic (provided as a parameter) and prints all posts containing external links. Of course, just having an external link doesn’t mean a post is spam, but having a quick list of all external links in a topic makes spotting suspicious posts much easier.
It’s very simple to use from the command line, just pass the topic URL as a parameter. For example:
.\Check-Discourse-Topic-Links.ps1 https://discussions.unity.com/t/is-it-a-good-idea-to-put-my-game-on-itch-io-first/1657629
This will output only the external links, along with the post number and author, like so:
External link found in post number: 1 by SpideyByte
http://itch.io
External link found in post number: 4 by meredoth
https://howtomarketagame.com/2025/05/22/more-games-that-made-the-itch-io-to-steam-transition/
External link found in post number: 4 by meredoth
https://howtomarketagame.com/2025/05/12/benchmark-itch-io-traffic/
External link found in post number: 4 by meredoth
http://itch.io
External link found in post number: 7 by SpideyByte
http://itch.io
The -verbose parameter works as expected and provides additional information about the results.
Here’s the gist for anyone who might find it useful:
https://gist.github.com/meredoth/a95398fdd5561d151bd5fd84d6ea2740