Up to now, Twitter user account information has been hard coded into the application for basic testing and fetching of user timelines requiring authentication. The recent progress of TwitterPatter now includes a login form and Options xml file used to store user settings and preferences for the application. Upon opening TwitterPatter, the application reads and tries to fetch the username and encrypted password from the options xml file. If a username and/or password has not been set and saved, TwitterPatter prompts the user with a login form requiring the login credentials of the twitter user. The application will take this info and

  1. store the user data with encrypted password in the options xml file and
  2. pass the user credentials to username and password accessors in the main TwitterPatter form window where they are used.

Currently, the options file is being read, and the application prompts for the username and password if not found in the options file, but the data is not yet being permanently written to the options xml file for storage and future retrieval.Next steps:

  • add encryption/decryption features to encrypt the password for storage in the options file and decrypt it after retrival for twitter authentication.
  • write twitter user account information to options xml file.

On another note, originally, I was considering using the .Net app.confg file to store and manage user preferences. Normally, that is not recommended due to system permissions and non-administrator users not being able to write to files in the programs directory. However, in this application, that would not have been an issue because TwitterPatter will be able to run from any location on a Windows system that has the .Net Framework 2.0 installed. After thinking about what benefits this had over a standard xml file, and realizing there really weren’t any, I decided to opt for a standard xml format instead.

So far I am happy with the development progress and excited about the next steps.

Twitter On!!!!
Ed – @pixel8r


Tonight, some issues were worked out that had been the source of a small bit of frustration. As is usually the case, the “issue” was not much of an issue at all, but more of a simple oversight in the code. Some times it really does help to step away from the code for a while and comb through it again with a clear head. Now, with that out of the way, new methods have been added to TwitterPatter adding the ability to grab and display the Friends Status Messages and Direct Messages.

There is still the matter of the User Timeline authentication failing and I am stumped as to why! The credentials are the same for other authenticated timelines, and this is the only one that seems to fail when tested.

Overall, the application is still very raw and in need of a make-over, but that will come after the main functionality is in place and the code is cleaned up a bit. In other words… Yea, it’s ugly!! (for now)

I’m sure you’ve heard this before, but I have Good news and I have Bad news.

First the bad news. For the last couple weeks, I have been scratching my head over the fact that twitter authentication failed and returned a “401 unauthorized” HTTP response any time I used TwitterPatter to retrieve the “user_timeline” from the twitter service.

I wrote code and rewrote it again trying to figure out how to get this to work. No matter what I tried, I just couldn’t seem to do it. Now after two weeks of failure (keep in mind that I do this mostly over the weekends and at night with what little free time I have to spare) , I was a bit frustrated. After all, that could have been quality time well spent pwning COD4 noobs (call of duty 4). At this point I decided to try a few of the other status time lines that require authentication to see if I could uncover anything. Here is where the Good news starts.

What I discovered was that apparently all the other time lines that require authentication are working fine using the same piece of code that fails for the user time line. I have no idea why this is happening and to be honest, it doesn’t make much sense to me. The credentials are all the same, the HTTP request is the same. But for some reason, the user time line just will NOT authenticate. Anyway, back to the good news. At this point I have been able to successfully retrieve the following time lines as an authenticated twitter account user.

  • friends_timeline : Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user’s friends. It’s also possible to request another user’s friends_timeline via the id parameter below.
  • friends : Returns up to 100 of the authenticating user’s friends who have most recently updated, each with current status inline. It’s also possible to request another user’s recent friends list via the id parameter below.
  • followers : Returns the authenticating user’s followers, each with current status inline

Next step is to format the data that is returned for display in the application window and apply the interactive functions to each message. I also need to find out why that user_timeline authentication fails.

If anyone has any ideas on what is going wrong with that, please leave a comment.

Happy twittering
Ed (@pixel8r)

TwitterPatter Update:
This past weekend was very productive in terms of TwitterPatter development. With the help of Pans Labyranth and Star Wars: Clone Wars animated series (volum 1 and 2) and a seemingly endless supply of Hot Cocoa, I went into Code Mode and got to work.

The most significant accomplishments from this round are the successful testing of:

  • the TP_TimeLines.TP_getPublicTimeline() method.
  • the TP_defaultHTML.set_default_HTML() method.
  • and the creation and inclusion of a Style Sheet (CSS) used to style the HTML generated the TP_TimeLines.TP_getPublicTimeline() method

TwitterPatter now has the ability to retrieve and parse the Twitter Public Timeline xml feed, generate HTML markup, and insert it into the WebBrowser control – all within a Windows .Net desktop application.

This screen shot shows TwitterPatter displaying the public timeline directly from twitter.com. The asthetics of the application leave a bit to be desired at this point, but I am focusing on basic usability and function right now. The visual appeal will come later.

Generic TwitterPatter GUI displaying Twitter’s public timelin

Time for a quick update! Development is moving along now. After sorting through some documents and deciding on the best options for displaying Twitter Status Messages I had some time to sit down and write some concept code.
Focus now is on writing and setting up the basic Classes and methods as a foundation to build additional features into.

I had given a lot of thought to the pros and cons of using the WebBrowser control vs a DataGridView control to display Twitter status messages. In the end, I have decided to use the WebBrowser control for this purpose. The WebBrowser control should require less code to manipulate and display the status contents. Given that Twitter is a “web” application, it also seems more appropriate to maintain that format.

Recent Progress

  • Built a generic GUI for testing functionality
  • Added the WebBrowser control to host the Twitter Statuses and Time Lines.
  • Added new API class (TP_defaultHTML)and methods (TP_set_Default_HTML) to set up the default document text of the WebBrowser Control.
  • Added new API class (TP_TimeLines) and methods (TP_get_Public_Timeline) to retreive the Public Twitter XML feeds.

More to come… Stay tuned!!

TwitterPatter Project:

January 25, 2008

TwitterPatter: the sound of little messages.

What is it?
TwitterPatter is a (soon to be) Twitter client and API written in C#. The application allow users of the Twitter.com service to retrieve, read, and post new twits.

After realizing the majority of twitter development information revolved around PHP and Curl, and what little .NET development efforts exist and those that do appear  incomplete, I decided to take steps to change that. Initially, the project will be closed source but I do intend to open it after the first release and choosing the right open source license.

Features Planned for inclusion:

  • Retrieve and display the Public Timeline
  • Retrieve and display User Timeline
  • Ability to submit new twits
  • Ability to reply to twits (clicking on a user name in a twit will start the new twit with the reply syntax automatically – @username.
  • Mark Favorites
  • Save favorites locally.
  • Auto-update or manual update twits based on user settings – Auto will display a timer of some kind ie, next update in X seconds.
  • Save and store persistent user settings (username, password, preferences, update intervals, etc.)

The name was chosen as a play on words of sorts based from the “Pitter patter” or the continuous repetition of light sounds.
I liked the rhyming connection made between Pitter and Twitter and the comparison of little sounds to little messages.

Pitter patter
n – : a series of light sounds;
n – : a quick succession of light sounds or pats;
v – : to run with quick light-sounding steps
n – : a series of small messages;
n – : a succession of small messages or twits;
v – : to communicate with quick small messages

I will use this blog to write about the progress of TwitterPatter and to post any new thoughts, ideas throughout its development.
I also hope to receive feedback from anyone who feels like contributing their thoughts and/or suggestions.