David Flatley

Archive for February, 2011

Using e4x with XML Namespaces for Twitter search

by on Feb.01, 2011, under Actual RIA info, Adobe AIR, Adobe Flex, Cloud APIs

I was working on a component for a client that uses search.twitter.com to find all relevant tweets based on a query string recently and I noticed there’s a lot of other samples out there that use some hefty XML parsing code to sift the data rather than make life easy with e4x. The Twitter search API uses XML namespaces in its results, and it seemed that many other posts out on the intertoobs (can I coin this term?) were implying that it caused problems within AS3. Not true. Since I didn’t find a lot on the Twitter search topic specifically, a new blog post was born. The following is a quick and easy sample of how to use e4x in your XML results by using the given XML namespaces.

For this client’s component, I didn’t need to authenticate users, but rather, search for all public streams via a query string. If you take a look at the Twitter search API docs you can see the process pretty straightforward, it’s just using URL query strings to retrieve data . Generally, you can search for tweets:

  • containing a word
  • from a user
  • to a user
  • referencing a user
  • containing a hashtag
  • or combining any of these options together

(continue reading…)

2 Comments :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!