Rome: Get Media URL Associated with Feed
in
Contributed Library Questions
•
2 years ago
I'd like to display images that are associated with rss feeds. I'm using Rome to fetch and I would prefer to use Rome, rather than having to use prohtml or loadstrings to get the media url associated with a given feed. I need to check if media exists for a given feed as well because not all feeds contain images. Before I attempt a more complicated solution, I was wondering if there's a simple getMedia() function built-in to Rome like there is for getTitle(), getAuthor(), getdescription(), etc. There is an image function for RSS feeds, but it looks like that's designed for image feeds, not text feeds that have associated media.
Rome has the native ability to return each of the elements title, link, guid, description, creator (getAuthor), and pubdate. But, I don't see anything in Rome docs for an equivalent function to return the image url.
Any help would be appreciated.
Here's a snippet of a page containing one complete feed entry that contains a media element:
Rome has the native ability to return each of the elements title, link, guid, description, creator (getAuthor), and pubdate. But, I don't see anything in Rome docs for an equivalent function to return the image url.
Any help would be appreciated.
Here's a snippet of a page containing one complete feed entry that contains a media element:
<item>
<title><![CDATA[Brown muck in surf is an algae bloom: Oil spill all but ruled out; nice weather may have spawned algae]]></title>
<link><![CDATA[http://www.times-standard.com/localnews/ci_17202891?source=rss]]></link>
<guid><![CDATA[http://www.times-standard.com/localnews/ci_17202891?source=rss]]></guid>
<description><![CDATA[Environmental officials said Tuesday that the chunky brown substance that stained the surf along Clam Beach appears to be an algae bloom and not an oil spill.]]></description>
<dc:creator>John Driscoll/The Times-Standard</dc:creator>
<pubDate><![CDATA[Wed, 26 Jan 2011 01:24:42 PST]]></pubDate>
<enclosure url="http://extras.mnginteractive.com/live/media/site127/2011/0126/20110126__local_beach.jpg"
length="46714"
type="image/pjpeg"/>
</item>
1