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:

  1. Anonymous10:09 AM

    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?

    ReplyDelete
  2. 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.

    ReplyDelete
  3. Anonymous7:42 AM

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

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

    ReplyDelete
  5. Anonymous8:47 AM

    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--;

    ReplyDelete
  6. Anonymous8:36 PM

    How is the API coming? Any documentation yet?

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

    ReplyDelete
  8. Anonymous3:34 AM

    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

    ReplyDelete
  9. Anonymous1:45 PM

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

    ReplyDelete