RSS提要到外部

时间:2013-01-04 00:06:32

标签: html rss

我正在寻找一种设置自己的RSS源的方法。我希望能够在我的网站上发布一些内容(要么锁定我,要么通过记事本),但我也希望它能将这些内容发布到Facebook和Twitter上。

是否有新手设置,或通过购买某些软件更好地解决这个问题?

我设置一个我会用笔记本更新的RSS源的不良尝试如下(虽然我没有暂时的工作):

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">


<channel>
    <title>First post title</title>
        <link>http://www.mysite.com</link>
    <description>I'm posting a lot of words to fill in this space for my first potential rss feed, let's hope it works!</description>
        <atom:link href="http://www.mysite.com" rel="self" type="application/rss+xml" />

<item>
    <title>Or maybe this is the first title</title>
    <link>http://www.mysite.com/page.html</link>
    <pubDate>Mon, 03 Dec 2012 16:50:32</pubDate>
    <guid isPermaLink="true">http://www.mysite.com/page.html</guid>
    <description>This is potentially the first post or perhaps the second post of the new feed being create.<description>
</item>


</channel>
</rss>

1 个答案:

答案 0 :(得分:1)

您的Feed有几个问题,即项目描述的无效日期和缺少结束标记。请尝试以下方法:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>

    <title>First post title</title>
    <link>http://www.mysite.com</link>
    <description>I'm posting a lot of words to fill in this space for my first potential rss feed, let's hope it works!</description>
    <atom:link href="http://www.mysite.com" rel="self" type="application/rss+xml" />

    <item>
      <title>Or maybe this is the first title</title>
      <link>http://www.mysite.com/page.html</link>
      <pubDate>Mon, 03 Dec 2012 16:50:32 GMT</pubDate>
      <guid isPermaLink="true">http://www.mysite.com/page.html</guid>
      <description>This is potentially the first post or perhaps the second post of the new feed being create.</description>
    </item>

  </channel>
</rss>

如果您手动创建Feed,则可以使用W3C Feed Validator验证标记。

您可以通过多种方式实现自动化,但在不知道您当前如何生成网站内容的情况下无法提供建议。