Last week I attended a presentation about Web 2.0 that described the recurring concepts behind the buzzword and looked at how (as well as if and when) those can be applied to enterprise systems and organizations.
One of the points of the presentation was that platforms are better than applications. Companies building platforms rather than just applications are the darlings of the web world. Some of the examples the presenter pointed out were: Facebook, Salesforce.com, Twitter, Wikipedia, Amazon, and Microsoft. As I was reviewing this list I was mentally noting the following: Microsoft - yes I've used live search and the APIs; Amazon - use this a lot on WIWM; Facebook - I use the site and I've been working on an application to bring WIWM into facebook; Twitter - yes, I use it but I haven't worked with it much other than some contributions to TeleTwitter... then it hit me. Why am I not making use of Twitter on the WIWM site? The site offers the ability to keep track of user's wishlists with RSS, why not post to their Twitter timeline when they add something new to their list.
Last Thursday night I set out to make it so. First I checked out the Twitter API documentation which said that basically you need to post to a URL with the updated text and it makes use of basic auth. Next I looked at the TeleTwitter code to see how the Twitter communication was handled. There was some good stuff there, but much more than I needed and it was tied to the TeleTwitter implementation. I'm sure I could have harvested the needed code (Hooray Open Source!) but I was looking for a simpler path.
That is when I found that Twitteroo offers their Core library (in binary form) on their site - look for TwitterooCore 1.4 API in the left-hand menu under "Download Twitteroo" - along with a console sample application and some pretty good documentation. After checking it out I knew this is what I was looking for.
Next step, reference the TwitterooCore.dll in my project and add the simple code to send a Twitter update to the user's twitter account. In the case of the WIWM site, I'm simply sending out "I added ProductX to my wishlist" along with a link to the user's wishlist on the site.
Here is the basic code needed to do so:
TwitterooCore core = new TwitterooCore(UsersTwitterID, UsersTwitterPassword);
core.ChangeStatus("The text that you want to post to the user's twitter timeline");
That's all there is to it. I've been wondering what other applications that I have worked on or even that I have used in the past could make use of this. One natural usage is updating your status whenever you make a blog post. I follow several people who do this and Kyle created a Community Server Module for doing so with your Community Server blog. What other places can you think of where something like this would be useful - to automate a Twitter Status update based on some action on your site, web app, or any other software really? I know this could really be abused. I don't really want to see things like "I just logged on to Ebay", "I'm chatting with Billy", and "I just spent $114.57 at Walmart" in twitter status updates, but it could be done.