Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET rss
Hi
 
i am very new in the software development. i am working on rss feed, and i want to display only image and their detail like name, type etc.from feed
 
i am currently following this site:
 
http://ctrlcvprogrammer.blogspot.in/2012/02/display-yahoo-news-using-rss-feed-in.html[^]
 

but i am not able to extract the images which are coming in the description tag. Can any body help me out?
 
thanking you in anticipation.
Posted 5-Jun-12 23:13pm
Edited 17-Jun-12 20:15pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There isn't a specific tag for the images. In fact, the RSS feed standard does not have an image tag per entry (there is an overall feed image but that is usually a logo). Instead, HTML is embedded in the description for the feed. This is how Yahoo puts the images in and this is how they are displayed by this application. You cannot simply get just the images. You do have a couple options though. One would be to try to parse out the images using C#. You could do that by looking for <img as the start and /> after the start of the image tag. Thus, you could find any images inside the HTML of the description text. You could further look for just the URL inside that string to find the location you need to pull the image directly (if you didn't want to just display the image using HTML).
  Permalink  
v2
Comments
arshad alam at 18-Jun-12 2:17am
   
i am getting all the details in the description tag. what i need how to extract all the info.
Tim Corey at 21-Jun-12 16:47pm
   
I tweaked my answer slightly to fix the issue with the editor messing up what I was trying to say. Basically, you need to find the image tag inside the string and then get the contents out of that. It will involve some string parsing. You will probably need to use RegEx if you want to be the most efficient about it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 534
1 Gihan Liyanage 298
2 RyanDev 260
3 Sergey Alexandrovich Kryukov 223
4 Richard Deeming 185
0 Sergey Alexandrovich Kryukov 8,936
1 OriginalGriff 7,891
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 21 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100