【问题标题】:yahoo pipes How can i swap title and description雅虎管道我如何交换标题和描述
【发布时间】:2012-01-29 05:45:53
【问题描述】:

我正在使用 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>

【问题讨论】:

    标签: yahoo-pipes


    【解决方案1】:

    这是一种方法 - 使用 3 Pipes 模块交换标题和描述字段:

    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>
    

    ...这是来自示例管道的相应输出,标题和描述已交换:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-28
      • 2011-03-26
      • 2015-05-12
      相关资源
      最近更新 更多