📜 ⬆️ ⬇️

Habr RSS without kata using Yahoo! Pipes

Since the futurico has outlined its rules for bots , I decided to talk about a small but convenient pipe ( Yahoo! Pipes ), which I did the other day.
I do not know about you, but I am terribly annoyed with the inscription “read more->” in RSS I decided to correct this problem (perhaps I will call the righteous wrath of the futurico, but formally there are no corresponding prohibitions in the rules).

We take RSS


Take the rss feed
It would seem that there should be an address www.habrahabr.ru/rss/main . The fact is that Y! P understands RSS only in UTF8 encoding. To fix this we use the wonderful xmliconv service. It’s extremely simple to use: william.cswiz.org/tool/xmliconv/?ie= encoding & url = url . In this case, we take the RSS at: william.cswiz.org/tool/xmliconv/?ie=cp1251&url=http : //habrahabr.ru/rss/main .

Download pages


Download pages
Here we have two blocks: an outer one - a loop for all elements, the result of executing an inner is assigned to item.description . The internal block takes the page at item.link , and leaves only the content between <div class = "groups_topic_text"> and <div class = "posttags"> . Between the specified tags is the main content of the page. Since the Fetch page returns an array (when the third element is filled, more than one element is returned), we set assign first results , that is, item.description takes the value of the first element of the array.

Rename


Rename
In fact, item.description is not a string yet. The string is item.description.content . That is, we simply rename item.description.content to item.description (description - this is the item that is displayed in the RSS reader).

the end


pipe out
We submit the result to the output.
This simple way you can handle RSS and static pages to get quite interesting results. You can find my pipe here , and here is its RSS . It may not always work. If there are any problems, let me know. Stability depends on Yahoo, William (xmliconv) and Futurico goodwill.

')

Source: https://habr.com/ru/post/28384/


All Articles