Yahoo Pipes: filter items in a feed based on words in a text file

我怕爱的太早我们不能终老 提交于 2019-12-22 12:12:47

问题


I have a pipe that filters an RSS feed and removes any item that contains "stopwords" that I've chosen. Currently I've manually created a filter for each stopword in the pipe editor, but the more logical way is to read these from a file. I've figured out how to read the stopwords out of the text file, but how do I apply the filter operator to the feed, once for every stopword?

The documentation states explicitly that operators can't be applied within the loop construct, but hopefully I'm missing something here.


回答1:


You're not missing anything - the filter operator can't go in a loop.

Your best bet might be to generate a regex out of the stopwords and filter using that. e.g. generate a string like (word1|word2|word3|...|wordN).

You may have to escape any odd characters. Also I'm not sure how long a regex can be so you might have to chunk it over multiple filter rules.




回答2:


In addition to Gavin Brock's answer the following Yahoo Pipes filters the feed items (title, description, link and author) according to multiple stopwords:

  • Pipes Info
  • Pipes Edit
  • Pipes Demo

Inputs

  • _render=rss
  • feed=http://example.com/feed.rss
  • stopwords=word1-word2-word3


来源:https://stackoverflow.com/questions/2693673/yahoo-pipes-filter-items-in-a-feed-based-on-words-in-a-text-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!