yahoo Pipes 如何交换标题和描述

发布于 2024-12-29 20:46:15 字数 442 浏览 0 评论 0 原文

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

I was creating a RSS feed using yahoo pipes but i want title in description and description in title. I want to swap the title and description.

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

I want

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我ぃ本無心為│何有愛 2025-01-05 20:46:15

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

  1. 获取提要:拉入 RSS 提要。我使用 雅虎财经 feed 作为示例。
  2. 重命名:将 item.title 复制为 newDesc,将 item.description 复制为 newTitle
  3. 创建 RSS:将标题设置为 newTitle,将描述设置为 newDesc,其他设置为默认值

我创建了一个示例管道,您可以从中查看和复制: http://pipes.yahoo.com/pipes/pipe.info?_id=ffc846056c71a4dd3df7b01d16fdd613

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

Here's one way you can do it - using 3 Pipes modules to swap the title and description fields:

  1. Fetch Feed: Pull in the RSS feed. I'm using a Yahoo Finance feed as a sample.
  2. Rename: Make a copy of item.title as newDesc, and item.description as newTitle
  3. Create RSS: Set title to newTitle, description to newDesc, others as default values

I created a sample pipe you can view and copy from: http://pipes.yahoo.com/pipes/pipe.info?_id=ffc846056c71a4dd3df7b01d16fdd613

Here's a sample from the original 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>

...and here's the corresponding output from the sample pipe, with title & description swapped:

<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>

Note: in my sample above something happened to the pubDate. I think it might be a Yahoo Pipes caching issue that will clear up the next time the pipe runs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文