Contents tagged with Twitter
I used C# and WCF, but I could have just as easily used an ASMX web service. This code is fairly simple. No I didn't write it initially. I found it online (Hey, we all have to start somewhere). I massaged it a little to fit my needs and boom, here it is. I have decided to leave the comments for the original code sample in the post. Note: This code will not run as listed. You have to have a password. This code has that as a shared variable, but I'm not showing that to you, seriously. I hope that this is of some help to you.
Yeah, so some of my friends asked me why I am not using a twitter library instead of calling the api directly. Yeah, I'm wondering that to. Seriously, the reason why I am doing that is that .net libraries to call out to twitter that I tried under VS 2008, did not work with Windows Azure. These libraries seemed to generate a security exception. Given azure's security requirements being a little more than regular asp.net, I decided to just drop the search for a library and make my calls on my own. Not sure if its a good decision or not, but its what I did.
PS. I hear that Full Trust and Native Code support are coming to Azure.
I've been working on this application to send out tweets at a particular time. One thing thing I want to do is be able to look at the logged in user's timeline. I've been playing with the ASP.NET 4.0 AJAX Previews, so I thought I would marry the two. As a result, I wrote the WCF code below in C#. Note that the password is hidden, so the code won't work until you add that in. Basically, I make a request to get the friends timeline. This gives me the most recent 20 posts by default. I store the result in an XmlDocument. I need to get that data out as a complex object of type UserStatusSvc as I am returning an array of that type. I used Linq to Xml for that.