This is the second part of a two part post on a Twitter portlet for Webcenter Interaction. The first part dealt with possible use cases for the portlet. So I have been trying to find time to write a portlet that lets you post to Twitter and read your timeline. I'm not big on not very good at interfaces so i'm still looking at other interfaces before i decide on the right XSL to use. It turns out that I should have done this 4 months ago instead of waiting thinking this was going to be a highly complex task.
Being unfamiliar with REST'ful applications(or so i thought till i read that this is just a new name for something we've been doing all along..like ajax), I had decided that I would probably be writing some kind of wrapping class for the twitter calls. Enter the yedda api's that are freely available here. I had discovered them some months back and had simply moved them to a todo folder. Little did i realize that when it came down to it I only need to write a few lines of code to use the api to get a simple portlet to post to my twitter timeline.
I plan on using something like the accordian slide from mootools demo'ed here to switch between submitting tweets, viewing timelines, etc. For now though all i have to offer is a cheesy textbox that submits to a timeline. I jinged it below ( i think you can pop it out to a full window if its tiny). Basically all i did was take the yedda dll and start making references. For the demo below all it took was 2 lines of code so you can concentrate on what you want to do with the portlet and how you want it to look. You can also make it wsrp or jsr compliant or create a web service out of it easily. All of this thanks to yedda which is by the way a pretty cool site.
Happy twittering and remember, not every company has an sms gateway lying around so a twitter interface just might do the trick if they want to start going mobile.
Cheesy Twitter portlet demo:
You can view the full resolution version at screencast.com.