We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › romeFeeder: extract links from a feed
Page Index Toggle Pages: 1
romeFeeder: extract links from a feed (Read 763 times)
romeFeeder: extract links from a feed
Jul 19th, 2009, 2:48am
 
Hi.
I'm trying to display updates of the Twitter public timeline width processing using the romeFeeder library.
I've got some problems trying to read the URI of the userpic from the feed.
Code:
<link type="image/jpeg" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/71932323/ava_bigger.png"/> 

When trying to acces the url like this:
Code:
entry.getLinks().get(1).href 


i get the following error:
Code:
href can not be resolved or is not a field 



this code
Code:
println(entry.getLinks().get(1)); 


prints something like:
Code:
SyndLinkImpl.href=http://s3.amazonaws.com/twitter_production/profile_images/71932323/ava_bigger.png
SyndLinkImpl.hreflang=null
SyndLinkImpl.rel=image
SyndLinkImpl.title=null
SyndLinkImpl.type=image/pjpeg
SyndLinkImpl.length=0


What do i have to do to access the SyndLinkImpl.href field?

Re: romeFeeder: extract links from a feed
Reply #1 - Jul 19th, 2009, 3:14am
 
Hi

I've never used this lib, so at your own risk. The reference seems to be here: https://rome.dev.java.net/apidocs/1_0/overview-summary.html

...as you can see, fields are private and have to be accessed via their getters. so
Code:
entry.getLinks().get(1).getHref() 

should do it.
But like I said I've never tried it myself.

Re: romeFeeder: extract links from a feed
Reply #2 - Jul 20th, 2009, 4:13am
 
this code works fine for me:
Code:
SyndLinkImpl tmp = (SyndLinkImpl) entry.getLinks().get(1);
String str = tmp.getHref();
Page Index Toggle Pages: 1