0

是否可以使用RABL创建有效的 RSS 提要?

或者是否有任何演练显示如何设置它?

这是我最终要输出的内容:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>My Stuff</title>
    <description>A description about this feed</description>
    <link>http://example.com/feed.rss</link>
    <item>
      <title>Article Title</title>
      <description>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</description>
      <pubDate>Thu, 13 Oct 2011 15:20:00 +0000</pubDate>
      <link>http://example.com/article/123</link>
      <guid>http://example.com/article/123</guid>
    </item>
    <item>
      <title>Another Article</title>
      <description>Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</description>
      <pubDate>Thu, 13 Oct 2011 07:17:00 +0000</pubDate>
      <link>http://example.com/article/123</link>
      <guid>http://example.com/article/123</guid>
    </item>
    <item>
      <title>Yep Another</title>
      <description>Nullam id dolor id nibh ultricies vehicula ut id elit.</description>
      <pubDate>Thu, 13 Oct 2011 05:48:00 +0000</pubDate>
      <link>http://example.com/article/123</link>
      <guid>http://example.com/article/123</guid>
    </item>
  </channel>
</rss>
4

1 回答 1

0

我建议使用 builder 或其他一些 XML 生成器来生成 RSS 提要。一切都是为了使用正确的工具来完成这项工作:http ://railscasts.com/episodes/87-generating-rss-feeds

于 2011-10-30T22:30:22.567 回答