Even though a similar service exists with
Twollow, they charge for their services. Since I
wanted a free version (although I do have way less features than they have
implemented), I started developing Zeta Twitter.

Technical implementation

The application is a .NET 3.5 console application that is intended to be used
as a scheduled task in the Windows Task Scheduler. You would e.g. configure the
task to run every 30 minutes.

Example screenshot of the output of the ZetaTwitter.exe console application.

You can add multiple Twitter accounts and for each account multiple keywords
to check. The whole configuration is done within a separate configuration file
called "ZetaTwitterConfiguration.xml". This file must be stored in the same
folder as the executable "ZetaTwitter.exe".

Example configuration file.

Currently all attributes are mandatory. Adjust the file in the downloaded
archive with the XML/text editor of your choice.

Internal function

Since being
nicely asked to explain my code a little bit, this chapter outlines the
highlights. Again the warning that none of the code is rocket science.

Configuration

The configuration is being stored in an XML file (as stated above) and being
read into two classes by simple XmlDocument method calls. I do read it manually,
not with any XML to class mapping.

The classes are:

Configuration - The root class which has an array of Account objects
each for each <account> node in the configuration file.

Account - The representation of one account. Has an array of string
objects for the keywords specified in the configuration file.

Processing

The processing is done the Program class. Using the IsAlreadyRunning property
(which is implemented with a mutex) to quit itself if it is already running. So
it is a single-instance console application.

Reason for that is that depending on the configuration file size, one run may
take rather long and I wanted to avoid that the Windows Task Scheduler fire
multiple instances. Twitter only allows a limited number of requests per IP
address per day, so you better play nice here.

The Main method consists of two nested loops, the outer iterates through all
Account objects of the configuration, the inner through all keywords of the
currently processed account.

Depending on the kind of query, different object types are being returned.
Again, please see the
tweet# reference Wiki for full options.

Notes

Currently all output is written to console window only. Ususally next steps
would be to use a logging framework like
LOG4NET instead to
log to various locations like e.g. e-mail or log files to get notified when
something goes wrong.

Current state of the tool

The tool was a quick development of approximately 2 hours. It currently does
exactly what I wanted it to do. Proably It does not even have any of the
features that you want it to have.

Here you have at least two
options:

Download the source code and enhance it the way you want it.

Tell me (down here in the comments section) which features are missing
that I should add.

Of course option 2. would be helpful to me when enhancing.

As usual, I will enhance, extend and correct the tool over the next weeks and
months. Keep the feedback coming!

History

2009-11-06Updated to latest tweet# library.

2009-06-29Added section that explains the internal code structure and some basic ideas behind the code.

Share

About the Author

Uwe does programming since 1989 with experiences in Assembler, C++, MFC and lots of web- and database stuff and now uses ASP.NET and C# extensively, too. He has also teached programming to students at the local university.

In his free time, he does climbing, running and mountain biking. Recently he became a father of a cute boy.

Well generally I never read such articles but saw you complain about it in lounge and decided to read.

I think that this is not an article. An article should explain a concept or how to achieve something. What you have is basically a tool and that too by your own account incomplete and potentially not usable by anyone except you.

The thing that really caught my eye was how all of the 1-voters said something like, "You did/didn't do this, therefore you get a one." There's no attempt at understanding why, or having a conversation, or even making constructive suggestions, just Bang! You get a one!

Can the article be improved? Of course. With these kinds of comments, I wouldn't be surprised if you didn't have any motivation to do this.

A one vote is certainly out of place for this article, especially in light of your reasonable answers.

The final point concerns so-called "advertising" in your bio, which is acceptable use according to CP rules. Unless I'm mistaken, the people complaining about this do not work for CP, and therefore have no business posting their personal viewpoints here. If they're serious about these complaints, they would have posted them in the Suggestions forum, instead of offering them as one more ridiculous reason for giving a one vote.

Terrible article. A beginner article should take time to explain concepts, not simply list a bunch of code. Moreover, the title of the article indicates that you would be demonstrating how to access twitter streams when, in fact, you do nothing of the sort.

1.) This was by intention. I wanted a "fire and forget" application on my server. Therefore console application.

2.) Since it is on my own server, this was by design, too.

3.) In fact this is stored in the "Utilities" section. I had no intention to show any of the code in the article (you can see all when downloading, of course); my solely intention was to provide the tool to others, since I found none at all on Google that was free.

As always, every article I write has at least two intentions:

- Provide code to the community to hopefully help others.
- Make my company more popular (why do you use quotes?)