惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
O
OpenAI News
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
有赞技术团队
有赞技术团队
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
Help Net Security
Help Net Security
爱范儿
爱范儿
W
WeLiveSecurity
V2EX - 技术
V2EX - 技术
Forbes - Security
Forbes - Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
SecWiki News
SecWiki News
A
About on SuperTechFans
Cloudbric
Cloudbric
N
Netflix TechBlog - Medium
博客园 - 司徒正美
S
Security @ Cisco Blogs
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
I
InfoQ
Engineering at Meta
Engineering at Meta
Google Online Security Blog
Google Online Security Blog
T
Troy Hunt's Blog
Latest news
Latest news
N
News and Events Feed by Topic
Security Archives - TechRepublic
Security Archives - TechRepublic
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
B
Blog
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
V2EX
J
Java Code Geeks
N
News | PayPal Newsroom
T
Tor Project blog
The GitHub Blog
The GitHub Blog

Steve Hanov's Blog

How this Canadian Startup Bought Millions of Impressions for $8,000 How to Run a Fellowship Program Into the Ground (and get 18M impressions in the process) My Waterloo Intern went back to school. I'll miss him dearly but here's how I replaced him with Hermes I learned Mandarin. Here's what it taught me about B2C SaaS. The VC's Waterloo Coffee Tour: Where to Find Canada's Next Unicorn How I run multiple $10K MRR companies on a $20/month tech stack How to Save a Gemini Canvas as Markdown A Ralph Loop for Reading: Beating GPT 5.2 with a 4k Context Window (and 4 GPUs) I built a Chrome extension that lets an LLM “see” tweets Make a web page screenshot service Automatically remove wordiness from your writing I found Security Vulnerability in your web application How to detect if an object has been garbage collected in Javascript My favourite Google Cardboard Apps O(n) Delta Compression With a Suffix Array Finding Bieber: On removing duplicates from a set of documents Let's read a Truetype font file from scratch A Quick Measure of Sortedness My thoughts on various programming languages A little VIM hacking
Fighting Blog Comment Spam with Qwen3 and Ollama
2025-05-13 · via Steve Hanov's Blog

I'll admit it. I've been neglecting my blog. I went back recently and found a wall of comment spam.

I've tried various ways of fighting it over the years. For a while, having written my own blog in php meant the problem wouldn't exist. The bots would relentlessly try submitting comments via wordpress URLs, which my system didn't understand.

When that stopped working, I introduced a hidden email field that only scripts could see. If it was filled out, I could ignore the comment right away. Somehow, that stopped working.

I built a user interface where I could click a delete button on each comment and they would implode on my screen. It was satisfying, but it still required me to log in once in a while and do it. So the comments built up, and I kind of gave up.

Luckily, I happen to have an AI rig in my bedroom, with ollama and several models installed. I decided to set it to work. I won't go into the details here. There is no need! Here is the prompt I mashed into Visual Studio Copilot, with Claude Sonnet 3.7 agent mode selected. Note that I had lost the database schema of my blog, so I didn't even know how the comments were stored.

  1. Carefully examine the BlogDb class and deduce the schema of the Comments table.
  2. Get the details of the database from the index.php file, including the connection details.
  3. Write a python script. On startup, it will connect to the database. If not present, it will add the "classification" string-type column to the comments type, with default value "".
  4. Devise a prompt that will take blog article contents, and a comment, and decide if the comment is spam or not.
  5. The python script will then iterate through all comments that have the empty-string classification field. It will forward each one and the spam classification prompt to an ollama server at https://example.com. Use the model "qwen3:32b".
  6. The python script will, based on the returned classification, update the classification field of the comment in the database to "spam" or "not-spam"

Ten minutes later, it was done. It then spent the next few hours classifying all the comments (about eight seconds each) and writing detailed analysis on its reasoning. They were fascinating to read.