如何将图像添加为RSS源的一部分

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何将图像添加为RSS源的一部分相关的知识,希望对你有一定的参考价值。

我在RSS提要中添加了标题,标题链接和说明。但无法将图像添加为RSS源的一部分。

请指导我如何在标记中包含图像并将其显示在RSS源中。

此致,古拉夫

答案

CDATA comments中包含您的描述并将图像作为html <img>标记插入。

TechCrunch在他们的Feed中有可以使用的示例:http://feeds.feedburner.com/TechCrunch

例如,从他们当前的饲料中,使用以下描述标记关于英国企业家的第一项:

<description>
    <![CDATA[
        <img src="http://eu.techcrunch.com/wp-content/uploads/startupbritain.jpg" alt="" />
        This morning in London, the UK's answer to <a href="http://www.whitehouse.gov/issues/startup-america">
        Startup America</a> launches, titled - guess what? - <a href="http://www.startupbritain.org/">Startup Britain</a>.
        That similarity aside, the initiative has been put together by a number of existing UK entrepreneurs and 
        is not being backed by any government money, unlike the Obama initiative. Instead, we have here a 
        ground-up entrepreneur-led initiative which is seeing over 60 leading brands offer services to 
        up-and-coming startups in the UK. This is not specifically about tech startups - but it may well appeal to that sector. 

        The campaign is being launched by Prime Minister David Cameron, who is known to be very pro-enterprise. 
        The UK has 270,000 businesses that start up every year but many fail due to a lack of support. So in 
        effect the Startup Britain initiative is doing a few things much more differently. It's offering a 
        package of discounts and free trial on business services like insurance, broadband, advertising, 
        office space and more. The claim is that this amounts to over £1,500 in value for every startup 
        company in Britain. Startup Britain is a portal site to a package of these services. 
        <img alt="" 
             border="0" 
             src="http://stats.wordpress.com/b.gif?host=techcrunch.com" 
             width="1" height="1" />
    ]]>
</description>

以上是关于如何将图像添加为RSS源的一部分的主要内容,如果未能解决你的问题,请参考以下文章

将 WordPress 特色图片添加到 RSS 提要

从RSS Feed中删除图像将Feed添加到其他站点时的说明

如何在 UITableViewCell 上添加 rss 图片

SWIFT/iOS:将 XML 数据(RSS 提要)解析为明文,将图像和视频添加到 textview

CozyRSS开发记录14-RSS源管理初步完工

以编程方式将按钮添加到片段