Guillermo Esteves's profile picture

Guillermo Esteves

Blocking and reporting Twitter spammers with a shell script

A simple shell script that blocks a Twitter spammer and sends a direct message to @spam to report it:

curl -s -u USERNAME:PASSWORD -d "id=$1"$1.xml
curl -s -u USERNAME:PASSWORD -d "text=$1&user=spam"

Replace USERNAME and PASSWORD with your username and password, obviously. It receives a single parameter, the offending spammer’s username, like so:

$ ./ agibbs1984a

My script-fu is not that strong, so if you can improve this, I’m open to suggestions.