Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Getting Enclosure Contents using Rome RSS parser (http://www.velocityreviews.com/forums/t960233-getting-enclosure-contents-using-rome-rss-parser.html)

galois271@gmail.com 04-30-2013 03:58 PM

Getting Enclosure Contents using Rome RSS parser
 
Hi all,

I just downloaded Rome to use in my podcast catching program. I can't seem to find any decent documentation on it. I am trying to access the podcast URLs that are located in the enclosures.

Here is what I tried: (everything works great, but getting enclosure contents/values)

public static void main(String[] args) throws IOException, IllegalArgumentException, FeedException
{
URL url = new URL("http://www.theskepticsguide.org/feed/rss.aspx?feed=SGU");
XmlReader reader = null;

try {

reader = new XmlReader(url);
SyndFeed feed = new SyndFeedInput().build(reader);
System.out.println("Feed Title: " + feed.getAuthor());

for (@SuppressWarnings("rawtypes")Iterator i = feed.getEntries().iterator(); i.hasNext();)
{
SyndEntry entry = (SyndEntry) i.next();
System.out.println("Title: " + entry.getTitle());
System.out.println("Description: " + entry.getDescription().getValue());
System.out.println("Link: " + entry.getEnclosures() + '\n');

}
} finally {
if (reader != null)
reader.close();

}
}

}

Jeff Higgins 04-30-2013 07:10 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On 04/30/2013 11:58 AM, galois271@gmail.com wrote:
> Hi all,
>

I can't seem to find any decent documentation on it.
No javadoc available? I'd really want that.
What does getEnclosures() return? A bag/box/bunch of enclosures?


Jeff Higgins 04-30-2013 07:20 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On 04/30/2013 03:10 PM, Jeff Higgins wrote:
> On 04/30/2013 11:58 AM, galois271@gmail.com wrote:
>> Hi all,
>>

> I can't seem to find any decent documentation on it.
> No javadoc available? I'd really want that.
> What does getEnclosures() return? A bag/box/bunch of enclosures?
>

Maybe once you have an enclosure there is some sort of content
extraction tool.

Chuck Johnson 04-30-2013 07:23 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On Tuesday, April 30, 2013 2:10:16 PM UTC-5, Jeff Higgins wrote:
> On 04/30/2013 11:58 AM, galois271@gmail.com wrote:
>
> > Hi all,

>
> >

>
> I can't seem to find any decent documentation on it.
>
> No javadoc available? I'd really want that.
>
> What does getEnclosures() return? A bag/box/bunch of enclosures?


It apparently returns a List, but I can't seem to use indexes to get the members. ??


Lew 04-30-2013 07:27 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
Chuck Johnson wrote:
> Jeff Higgins wrote:
>> galois271@....com wrote:
>>> I can't seem to find any decent documentation on it.

>>
>> No javadoc available? I'd really want that.
>>
>> What does getEnclosures() return? A bag/box/bunch of enclosures?

>
> It apparently returns a List, but I can't seem to use indexes to get the members. ??


First of all, OP, don't ever do this:

@SuppressWarnings("rawtypes") ...

Second, give us this, please:

http://sscce.org/

As to docs for Rome, where have you looked so far?

--
Lew

Chuck Johnson 04-30-2013 07:58 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
> First of all, OP, don't ever do this:
>
>
>
> @SuppressWarnings("rawtypes") ...
>
>
>
> Second, give us this, please:
>
>
>
> http://sscce.org/
>
>
>
> As to docs for Rome, where have you looked so far?
>
>
>
> --
>
> Lew


I suppressed warnings because I'm just trying to get Rome to work, and that was a way recommended by Eclipse, sort of a TDD approach: make it so it doesn't fail. I'm really only testing Rome at the moment, no serious code.
Secondly, you have all my code, save the import statements and class declaration. Unless, you have Rome & JDOM installed, this code won't run for you. My hope is that one of you guys out there has actually used Rome before, and can help me.

Chuck Johnson 04-30-2013 08:08 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On Tuesday, April 30, 2013 2:58:01 PM UTC-5, Chuck Johnson wrote:
> > First of all, OP, don't ever do this:

>
> >

>
> >

>
> >

>
> > @SuppressWarnings("rawtypes") ...

>
> >

>
> >

>
> >

>
> > Second, give us this, please:

>
> >

>
> >

>
> >

>
> > http://sscce.org/

>
> >

>
> >

>
> >

>
> > As to docs for Rome, where have you looked so far?

>
> >

>
> >

>
> >

>
> > --

>
> >

>
> > Lew

>
>
>
> I suppressed warnings because I'm just trying to get Rome to work, and that was a way recommended by Eclipse, sort of a TDD approach: make it so it doesn't fail. I'm really only testing Rome at the moment, no serious code.
>
> Secondly, you have all my code, save the import statements and class declaration. Unless, you have Rome & JDOM installed, this code won't run for you. My hope is that one of you guys out there has actually used Rome before, and can help me.


The rometools link didn't help. On that site, are a bunch of dead links. :(

Jeff Higgins 04-30-2013 08:28 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On 04/30/2013 04:08 PM, Chuck Johnson wrote:

>> I suppressed warnings because I'm just trying to get Rome to work,

and that was a way recommended by Eclipse,

??

sort of a TDD approach: make it so it doesn't fail.

TDD approach? really? I'll have to look into your no-fail approach.
] hadn't heard of it before.

I'm really only testing Rome at the moment, no serious code.
Secondly, you have all my code, save the import statements and class
declaration.
Unless, you have Rome& JDOM installed, this code won't run for you.

As things stand there is no need for anyone to run the code.

My hope is that one of you guys out there has actually used Rome before,
and can help me.

Hasn't sunk in yet?

The rometools link didn't help. On that site, are a bunch of dead
links. :(

The frownny is funny.


Lew 04-30-2013 08:59 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
Chuck Johnson wrote:

> [attribution restored: please attribute citations]
> Lew wrote:
>> First of all, OP, don't ever do this:
>>
>> @SuppressWarnings("rawtypes") ...
>>
>> Second, give us this, please:
>>
>> http://sscce.org/
>>
>> As to docs for Rome, where have you looked so far?

>
> I suppressed warnings because I'm just trying to get Rome to work,


A) Not relevant.
B) Not really going to do what you intend.
C) Don't use raw types.

> and that was a way recommended by Eclipse,


Nonsense.

> sort of a TDD approach: make it so it doesn't fail.


That's rather the opposite of TDD.

> I'm really only testing Rome at the moment, no serious code.


Okay, not really a good reason to indulge in bad habits, but okay ...

> Secondly, you have all my code, save the import statements and class declaration.


"... all ... save ..." is not the same as "all".

And I didn't ask for all your code, I asked for an SSCCE.

> Unless, you have Rome & JDOM installed, this code won't run for you.
> My hope is that one of you guys out there has actually used Rome before, and can help me.


I had no troubles with the linked project site. The Javadocs downloaded just fine. DId you
try them?

--
Lew

Roedy Green 04-30-2013 10:00 PM

Re: Getting Enclosure Contents using Rome RSS parser
 
On Tue, 30 Apr 2013 08:58:02 -0700 (PDT), galois271@gmail.com wrote,
quoted or indirectly quoted someone who said :

>I can't seem to find any decent documentation on it


IntelliJ Idea and presumable most other IDES have a feature to let you
point at reference and see all the possible methods you could call on
it. It will then show you the parms and individual method needs.
These are invaluable for navigating through code that parses
something.
--
Roedy Green Canadian Mind Products http://mindprod.com
Nothing is so good as it seems beforehand.
~ George Eliot (born: 1819-11-22 died: 1880-12-22 at age: 61) (Mary Ann Evans)


All times are GMT. The time now is 07:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.