sthg
sthg

Reputation: 1135

Adding item.title to item.link in Yahoo Pipes

I need to build a Yahoo! Pipe that copies the item.title element and adds it to the end of the item.link element.

Example input:

<item>
  <title>helloworld</title>
  <link>http://www.example.com/abc</link>
</item>
<item>
  <title>whatsup</title>
  <link>http://www.example.com/def</link>
</item>

Example output:

<item>
  <title>helloworld</title>
  <link>http://www.example.com/abc?helloworld</link>
</item>
<item>
  <title>whatsup</title>
  <link>http://www.example.com/def?whatsup</link>
</item>

Upvotes: 1

Views: 189

Answers (1)

janos
janos

Reputation: 124646

You can do that using the Regex operator, by using ${...} notation in the replacement pattern to refer to other fields, in this case ${title}:

  • In: item.link
  • replace: $
  • with: - ${title}

In the replace parameter I used $ to match the end of item.link, and in with ${title} will be replaced with the content of item.title, thus appending to the end of item.link.

FYI this other question covers a more general case of combining two fields:

In yahoo pipes, how can I combine 2 fields?

Upvotes: 1

Related Questions