Twitterbot. No Really, I Need To Be Stopped
Ok, Twitterer almost had a valid excuse, but this is just bloody unnecessary. I wrote a C# (Mono) news bot for twitter last night out of boreom while waiting for a client to finish writing the webservices needed for my project. The Twitterbot is based very loosely on Mario Menti's perl source code, in that I took the tinyurl idea (and that's about it). I wrote the bot with the concept in mind of using one bot to manage all the feeds at once, which does have a slightly undesirable affect of posting the updates for all the feeds at once, but with a bit of tweaking that can be lessened.
The bot is used to run the following twitter-things: googlenews, googlenewsworld, googlenewssports, googlenewsus, googlenewsent
the technical details
The Twitterbot makes use of RSS.NET for all its incoming feed parsing, but uses the standard System.Net.WebRequest class for posting to both twitter and retrieving the proper tinyurl link. The basic structure of the bot is simple, whenever it grabs new items it'll check that feed's last (stored internally) items to prevent duplication of twitter-posts, and then will shorten the title, generate the tinyurl link and finally post the tiny message to twitter. One of the issues I discovered with Google News is that they randomize the story providers for any given story, i.e. a they might push out a story to their feeds about China's shooting down of a satellite but each time the bot updates that feed may return a different title for the story from a different news organization. In order to prevent flooding, the bot currently has a twitter-posting maximum of two per iteration, which combined with the update interval (30 minutes) helps cut down on both duplicate stories, but also spamming the living hell out of twitter.
The file format that the bot reads feeds and twitter information from is also simple:
<feeds> <!-- & -> &amp; --> <feed name="Google News" url="http://news.google.com/news?ned=us&amp;topic=h&amp;output=rss" twitter="user" password="pass"/> </feeds>
I think I am going to release this as open source in the very near future but I want to check with the twitter guys first to take any steps necessary to prevent spamming their goofy little service. I really think my bot would help organizations use twitter as a minimalistic content delivery platform (market-speak!) if they already spit out content in standard RSS formats elsewhere, but I don't want to step on any toes.
A nice and neat little Twitterbot, all in less than 300 lines of code :)






(417) Expectation Failed
I understand that twitter changed it's API which is causing this error.
How do I fix it?
I'm trying to run this on a linux box using mono.
cancelled twitter accounts
It's interesting how all the twitter accounts mentioned in this post have been deleted: googlenews, googlenewsworld, googlenewssports, googlenewsus, googlenewsent
Re: cancelled twitter accounts
They were shut down because Twitter claimed they violated the Terms of Use by not having enough "original cnotent" or some other malarkey
stop TwitterBot ?
It works great but I wish I could stop it, or at least modify the feeds it is broadcasting.
Same for me
Same problem for me ... seems there is no way to stop it.
401 Unauthorized
Every time I try to use Twitterbot (running on Mono in OS X 10.4) I get a 401 Unauthorized error when the bot tries to post. I'm using my Twitter username in the feeds.xml config file, but I've also tried using my email address and the user id number, and none of them seem to work.
Any idea what I'm doing wrong?
Ditto
I have run into the same issues on Mac OS X with Mono 1.2.3 for some reason, I've moved my Twitterbots to my FreeBSD machine where they work fine. If you can help me find the bug, let me know at tyler@bleepconsulting.com