1
votes

this is my first time using Twitter API therefore I am not very familiar. I want to retrieve all twitter tweets which has a hashtag, for example #converse

This is my code:

var myXMLLoader:URLLoader = new URLLoader(); 
myXMLLoader.load(new URLRequest("http://search.twitter.com/search.atom?q=converse"));
myXMLLoader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void{ 
    var myXML:XML = new XML(e.target.data);
    trace(myXML.status[0].text);

    load1.text = myXML.status[0].text;
}

This is the error I got :

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://search.twitter.com/search.atom?q=converse at mainClass()

I don't understand the URL and I don't know if the syntax is correct. I searched in the internet and this is how they retrieve the feeds.

1
Try adding a listener for that error and trace whatever info you can get from it. - grapefrukt
FOr sure you are not listening to all events you should listen. As Grapefrukt says check more why this happens. Also it may be easy to use an existing API. How about dev.twitter.com/docs/twitter-libraries#flash - Adrian Pirvulescu
Hi Thanks for your reply! I managed to display tweets with this url twitter.com/statuses/user_timeline.xml?screen_name=SMCSConverse but I want to retrieve tweets with a specified hashtag. But the resources online are making me confused. Thanks for your help! - dada050909
First thing I would do is to add listeners for the HTTPStatusEvent.HTTP_STATUS, IOErrorEvent.IO_ERROR and SecurityErrorEvent.SECURITY_ERROR events. These will give you more insight into what's going wrong. - david.emilsson

1 Answers