getting pictures from twitter feed
Hello i have a atom feed from twitter and every entry looks like this:
<entry>
<id>tag:search.twitter.com,2005:9708181705990144</id>
<published>2010-11-30T20:39:45Z</published>
<link type="text/html" href="http://twitter.com/eva_starlily/statuses/9708181705990144" rel="alternate"/>
<title>@sarahpalinusa If I'd used language like Willow did, for ANY reason whatsoever, my Dad would have grounded me for months. Learn to parent.</title>
<content type="html"><a href="http://twitter.com/sarahpalinusa">@sarahpalinusa</a> If I&apos;d used language like Willow did, for ANY reason whatsoever, my Dad would have grounded me for months. Learn to parent.</content>
<updated>2010-11-30T20:39:45Z</updated>开发者_JAVA百科;
<link type="image/png" href="http://a0.twimg.com/profile_images/1179401088/b6c2b6ec-3432-476b-9ded-473986f12fd5_normal.png" rel="image"/>
<twitter:geo>
</twitter:geo>
<twitter:metadata>
<twitter:result_type>recent</twitter:result_type>
</twitter:metadata>
<twitter:place>
<twitter:id>8c9bcefd88d617fe</twitter:id>
<twitter:full_name>Greenwood - Coxwell, Toronto</twitter:full_name>
<twitter:type>neighborhood</twitter:type>
</twitter:place>
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
<twitter:lang>en</twitter:lang>
<author>
<name>eva_starlily (Laura)</name>
<uri>http://twitter.com/eva_starlily</uri>
</author>
</entry>
now i would like to have the url from the second link tag wich is the poster image. How can i select this within as3? I tried the following:
for each(var entryXML:XML in resultXML.rootNamespace::entry)
{
trace(entryXML.rootNamespace::link.@href);
}
But this also gives me the href from the first link. So how can i filter this so i only get the href from the second link?
Try something like this:
var imageUrl : String = entryXml.link.(@type=="image/png").@href;
精彩评论