开发者

Regex with YahooPipes: Append Text to the end of Description field

开发者 https://www.devze.com 2023-04-10 20:45 出处:网络
I want to append some text to the end of the description field. How do I select all contents and append to the end of the item field?

I want to append some text to the end of the description field. How do I select all contents and append to the end of the item field?

Currently the way I do it is a little crude.

Since the description field is an HTML page I am assuming that most often there will exist </p>. Hence I replace </p> with </p> Additional text. The only problem is this occurs anywhere in the body of the HTML page.

Hence here is the way I currently do it with a REGEX box (Sorry I cannot paste an image of my Yahoo pipe):

item.description replace &开发者_C百科lt;/p> with </p> Article Courtesy: ${link}

item.content:encoded replace </p> with </p> Article Courtesy: ${link}

This works great with 2 problems.

It does not always occur at end of page, but somewhere in the middle or maybe even at the top.

If the </p> does not exist in the HTML page then the content to be added will not go in.

Thanks


If your aim is just to add the text at the end, why not use this

item.description replace $ with Article Courtesy: ${link}

This will just add your string at the end of current content


How about using </body> instead?

0

精彩评论

暂无评论...
验证码 换一张
取 消