Searching the Digg API with AS3

Posted on July 27, 02009
Filed Under Flash, Journal

I've been messing around with a lot of social API's recently. Most of the common ones have their own AS3 wrappers although often these are authored by someone else. The diggflashdevkit for the Digg API for example is written by the guys over at Stamen who, as I'm sure you're aware, have got some game.

It's a nicely architected framework with cleanly separated model and service classes. Calls to Digg are proxied through the com.digg.services.API class. This contains methods for all the API calls except strangely for SearchStories. It could be I've missed something but I gave up looking and wrote a method for it. Just add this function to the API class and call it as you would any other method.

public static function searchStories( query: String ):StoriesResponse
{
   var request:URLRequest = new URLRequest(getURL('search/stories'));
   var args:URLVariables = new URLVariables()
   args['query'] = query
   if (mediaSize)
   {
      if (!args['size']) args['size'] = mediaSize;
   }
   request.data = args;
   return load(request, new StoriesResponse()) as StoriesResponse;
}
Share/Bookmark

Related Journal Entries

  1. The Computus Engine on Google Code
  2. Building an accurate Timekeeper in AS3
  3. Cynergy MultiTouch Calendar for AIR 2.0
  4. Project updates April 2009
  5. A review of Temporal Web Standards
  6. Projects update March 2009
  7. The project architecture
  8. Google TimeMap
  9. Hacking the Date class for GeoLocation
  10. AS3 infinite timeline: Proof of concept
  11. Flash on the beach 2008
  12. Choosing an AS3 component framework
  13. Coding practices
  14. Building an accurate Timekeeper in AS3: II
  15. TED Global 2010, Hyper Island Creativity Lab and Flash On The Beach

Comments

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments