从rss描述标签的字符串中馈送图像 [英] feed image from string of rss description tag

查看:84
本文介绍了从rss描述标签的字符串中馈送图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在软件开发方面非常新.我正在处理rss feed,我只想显示feed中的图像及其详细信息,例如名称,类型等.

我目前正在关注此网站:

http://ctrlcvprogrammer.blogspot.in/2012/02/display-yahoo-news-using-rss-feed-in.html [

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.

推荐答案

图像没有特定的标签.实际上,RSS提要标准每个条目都没有图像标签(有一个总提要图像,但通常是徽标).相反,HTML嵌入在提要的描述中.这就是Yahoo放置图像的方式,也是此应用程序显示图像的方式.您不能仅获取图像.您确实有几个选择.一种方法是尝试使用C#解析图像.您可以通过在图像标记的开始位置查找<img并在其后查找/>来实现.因此,您可以在描述文字的HTML内找到任何图像.您可以进一步在该字符串中查找URL,以找到直接拉出图像所需的位置(如果您不想仅使用HTML显示图像).
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).


这篇关于从rss描述标签的字符串中馈送图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆