雅虎管道如何交换标题和描述

时间:2012-01-29 05:45:53

标签: yahoo-pipes

我正在使用yahoo管道创建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>

1 个答案:

答案 0 :(得分:0)

以下是一种方法 - 使用3管道模块交换标题和说明字段:

  1. 获取Feed:拉入RSS Feed。我使用Yahoo Finance feed作为样本。
  2. 重命名:将item.title复制为newDesc,将item.description复制为newTitle
  3. 创建RSS:将标题设置为newTitle,将描述设置为newDesc,将其他设置为默认值
  4. 我创建了一个可以查看和复制的示例管道: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>
    

    ...这里是样本管道的相应输出,标题为&amp;描述交换:

    <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发生了一些事情。我认为这可能是雅虎管道缓存问题,将在下次管道运行时清理。