2012-01-29 39 views
0

我正在使用雅虎管道创建RSS源,但我想在标题描述和标题描述中使用标题。我想交换标题和说明。雅虎管道我如何对换标题和描述

<item> 
<title>"**title**"</title> 
<description>"**description**"</description> 
<link>http://link</link> 
</item> 

我想

<item> 
<title>"**description**"</title> 
<description>"**title**"</description> 
<link>http://link</link> 
</item> 

回答

0

这里是你可以做一个办法 - 用3个模块交换标题和描述字段:

  1. 获取传递:拉RSS提要。我使用Yahoo Finance feed作为示例。
  2. 重命名:请item.title的副本newDesc,并item.description作为newTitle的
  3. 创建RSS:设置标题newTitle的描述newDesc,其他为默认值

我创建了一个样本管你可以查看和复制:http://pipes.yahoo.com/pipes/pipe.info?_id=ffc846056c71a4dd3df7b01d16fdd613

下面是从原来的Yahoo Finance RSS feed样本:

<item> 
    <title>Samsung Posts $7.4B Profit as Handsets Mask Weak Chip Sales</title> 
    <link>http://us.rd.yahoo.com/finance/news/rss/story/SIG=149kpevtc/*http%3A//us.rd.yahoo.com/finance/news/topfinstories/SIG=126hhlj6u/*http%3A//finance.yahoo.com/news/samsung-posts-7-4-bln-234859667.html?l=1</link> 
    <description>Samsung Electronics Co., the world's top technology firm by revenue, reported record quarterly profit of $7.4 billion on Friday, with strong sales of its Galaxy range of phones masking sharply lower memory chip sales.</description> 
    <guid isPermaLink="false">yahoo_finance/1866191516</guid> 
    <pubDate>Fri, 26 Oct 12 00:55:44 GMT</pubDate> 
</item> 

...和h ERE是从样品管输出相应的,标题为&描述交换:

<item> 
    <title>Samsung Electronics Co., the world's top technology firm by revenue, reported record quarterly profit of $7.4 billion on Friday, with strong sales of its Galaxy range of phones masking sharply lower memory chip sales.</title> 
    <link>http://us.rd.yahoo.com/finance/news/rss/story/SIG=149kpevtc/*http%3A//us.rd.yahoo.com/finance/news/topfinstories/SIG=126hhlj6u/*http%3A//finance.yahoo.com/news/samsung-posts-7-4-bln-234859667.html?l=1</link> 
    <description>Samsung Posts $7.4B Profit as Handsets Mask Weak Chip Sales</description> 
    <guid isPermaLink="false">yahoo_finance/1866191516</guid> 
    <pubDate>Sat, 30 Mar 1918 19:36:14 +0000</pubDate> 
    </item> 

注:在我的样本上述事情发生的pubdate的。我认为这可能是雅虎管道缓存问题,将在下次管道运行时清除。