4
votes

I am building an online Rss reader. I want to be able to display images along with the article title and description.

I am using google feeds API to read the rss feed from CNN (http://rss.cnn.com/rss/edition.rss). In the feed I get, I cannot find a link to the appropriate image anywhere.

Sample JSON result: enter image description here

XML NODE: xml node of a single entry

I know that other rss readers, for examaple Feedly, can display relevant images for each article: http://www.feedly.com/home#subscription/feed/http://rss.cnn.com/rss/edition.rss enter image description here

I tried scraping the actual CNN page, hoping to pull the image straight from there. However, the html page that i read is missing the image/video that I am interested in.

I have been trying to figure this out for a while.. I thought the image link should be included in the 'content' field of a rss entry?

Any help will be greatly appreciated. Thank you!

1

1 Answers

3
votes

RSS readers can only display as much data as it receives (obviously). Looking at the raw XML of the feed you provided, there is no image link included in any <item> tag. It is not a required field, apparently. A simple reader, which is what most people build, will not display images from that feed.

If feedly is showing you images, it is doing more than simply displaying the feed (the link provided redirects to their homepage, so i couldn't take a look there).

Your initial thought is correct. Either the feed would normally include an image, or, better yet, have it embedded in the content (see any description tag in http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss).

Off-topic, your JSON picture is too small to read without drastically zooming in the page. Hopefully that's not just me.