Tuesday, April 08, 2008

Twitter API in ActionScript

I noticed that the Twitter ActionScript API was a bit out of date to say the least. I had to update it for a small project I was playing around with. I sent a note to al3x about this, and suggested open sourcing the API. He agreed and so here it is.
It needs a lot of work. I basically removed the old authentication scheme, since it relied on setting the Authorization HTTP header and that is no longer allowed starting in Flash Player 9.0.115. This also let me remove a dependency on a third party base 64 encoder. I guess a base64 encoded string that includes your username and password is supposed to be secure :-) I also fixed the loadFriends method, as this now returns users not status messages. I will get the API up to date, but if anyone wants to help out then just send me a note.

9 comments:

Anonymous said...

This is fantastic. Do you have plans to make it AS3 (Flash CS3) compatible, so it's useful for those of us not developing on Flex?

Unknown said...

It is pure ActionScript 3, so it will work on Flash CS3 or Flex. I have only personally tested it on Flex, but there are no dependencies.

Anonymous said...

Thanks for your efforts, but it looks like you've only made the swc available and not the actual source. Why?

Unknown said...

The source is available. Here is checkout info: http://code.google.com/p/twitterscript/source/checkout .

Anonymous said...

Man I'm embarrassed, I saw the source checkout right after I posted. Been one of those mornings. My apologies. Also it's excellent that you picked up the touch that Twitter so stupidly dropped. Twitter.coolness--;

Anonymous said...

How is the API coming? Any documentation yet?

Unknown said...

It's relatively current: http://fupeg.blogspot.com/2008/08/search-twitter-from-flash.html . I will try to add some documentation.

Anonymous said...

Very nice. I have a few questions,
Would it be possible to get a link to the ASDocs?
Is TwitterEvent.ON_DESOTRY a typo? (for TwitterEvent.ON_DESTROY)
Is there an event that "notifies" us when login succeeds?
Thanks a lot

Anonymous said...

i have a macintosh and cs4. can someone help as i can't find which directory to install the swc file into.