I had already written multiple Twitter bots by this time so I decided to just use some of my existing code to poll Twitter’s search API. Essentially, the “documents” I mentioned above were actually tweets containing the terms “book” or “books.” Two and a half days later I had a working prototype that could generate a book recommendation from a given tweet. It was at this time that I added steps 5 and 6:
Tag URLs returned from Amazon’s ItemSearch with an affiliate ID; and Reply to the tweeting user with their new book suggestion
Four months later and I had generated over $7,000 in sales for Amazon with over $400 commission for myself.
(via How I Made Money Spamming Twitter with Contextual Book Suggestions – charleshooper.net)
Read this is you are determined to build a Twitter keyword spambot. The author throttled the amount of tweets, recorded usernames so he wouldn’t annoy the same person twice and generally did his best to build a relevant spambot with good etiquette.