Creating and or hosting RSS feed?!

584 views
Skip to first unread message

jo2

unread,
May 30, 2016, 7:28:41 AM5/30/16
to Node-RED
Hi!

I am using Pushbullet in flows to send notifications of certain updates.
I see that one can create Pushbullet channels, and that these are based on RSS feed.
Hacing a Pushbullet channel, I could "push" updates to it, and then "anyone" could subscribe to them...

Would it be possible / feasible to implement a RSS feed in Node-RED? Or I am way off here?!

Cheers
-jo2

peter adshead

unread,
May 30, 2016, 8:07:42 AM5/30/16
to Node-RED
Well you have the Feedparse node which check a RSS a feed every x minutes for any new or different feeds.
On the host a RSS feed , RSS is just a http page where the output is in xml , so there is the nodes to make it all ready . 

jo2

unread,
May 30, 2016, 9:20:02 AM5/30/16
to Node-RED
Thanks for that! 

Curious if anyone has done some stuff on RSS feed hosting in Node-RED?

jo2

unread,
May 30, 2016, 10:27:05 AM5/30/16
to Node-RED
Or is the answer: Use the rss package?!

Nicholas O'Leary

unread,
May 30, 2016, 5:27:40 PM5/30/16
to Node-RED Mailing List
The rss format is really fairly simple to generate - I wouldn't personally bother with a separate package.

A quick google finds this mustache template example which you can use directly in the Template node:

You just need to pass it a suitably crafted message object with the contents you want in the RSS feed.

Nick

On 30 May 2016 at 15:27, jo2 <jo.to...@gmail.com> wrote:
Or is the answer: Use the rss package?!

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Julian Knight

unread,
May 30, 2016, 7:57:49 PM5/30/16
to Node-RED
Keep meaning to do some RSS work in NR as I consume rather a lot on a daily basis just trying to keep up with the tech and cyber security news. :)

Interesting call on the mustache template, I'll have a look at that.

The biggest problem I have with RSS is converting partial feed content into full content - there are far too many feeds that only publish a summary - probably thinking that it protects their advertising revenue - in reality it just limits people's exposure to the feed.

The other issue is that I sometimes get quite behind with some feeds and my usual Feedly service only keeps a limited span of data. Fine on the iPad where the iPad app accumulates the feeds but not so good when I want to use different devices.

Anyway, I'm rambling and this doesn't have much to do with your issue. All I can say is that NR should be a great tool for creating custom RSS feeds. Lets see if the mustache template does the job.

jo2

unread,
May 31, 2016, 3:04:42 AM5/31/16
to Node-RED
Thanks Nick, that template looks very convenient!
I am working on the dynamic HTML link sources, with this template things starts coming together I think :-)

Cheers
-jo

jo2

unread,
Jun 2, 2016, 5:36:47 AM6/2/16
to Node-RED

This now looks to be working well, the RSS feed generated based on customizing the Mustache template Nick pointed to, and another flow generating the dynamic HTML for the RSS item "link" elements. I probably should use Mustache for the HTML as well, right now it is "hard-coded" in a function node, but pretty simple stuff in this case.

The feed can be found here if anyone want to have a look:

I'll try stop asking "Can this be done in Node-RED", and start asking "How would you recommend doing it"...;-)

Cheeers
-jo

Marko S

unread,
Nov 28, 2016, 4:58:31 PM11/28/16
to Node-RED
jo2 can you post the flow please?

Dne četrtek, 02. junij 2016 11.36.47 UTC+2 je oseba jo2 napisala:

jo2

unread,
Dec 5, 2016, 6:34:55 AM12/5/16
to Node-RED
Hi!

Sorry for late response, I have added the main RSS flow below.
It has references to other flows, but should be straightforward to modify to other needs :-)

Cheers
-jo


[{"id":"10c11edb.a193b1","type":"http in","z":"40bf4776.bf40b8","name":"RSS Feed","url":"/rss/luftkvalitet/feed","method":"get","swaggerDoc":"","x":110,"y":700,"wires":[["21036559.3c3fb2"]]},{"id":"a14ebf7b.99b6c","type":"http response","z":"40bf4776.bf40b8","name":"","x":770,"y":700,"wires":[]},{"id":"aa97037b.2062c8","type":"template","z":"40bf4776.bf40b8","name":"Feed","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n      {{#payload.feed}}\n      <title>Luftkvalitet.info</title>\n      <link>http://luftkvalitet.mybluemix.net/luftkvalitet/rss</link>\n      <description>Luftkvalitet.info air quality measurements in Norway.</description>\n      <pubDate>{{lastBuildDate}}</pubDate>\n      <generator>Node-RED</generator>\n      <atom:link href=\"http://luftkvalitet.mybluemix.net/rss/luftkvalitet/feed\" rel=\"self\" type=\"application/rss+xml\" />\n      {{#items}}\n        <item>\n          <title>{{station}}</title>\n          <description>{{measurementsBrief}}</description>\n          <link>{{link}}</link>\n          <guid isPermaLink=\"false\">{{station}}-{{time}}</guid>\n          <pubDate>{{publishDate}}</pubDate>\n        </item>\n      {{/items}}\n    {{/payload.feed}}\n  </channel>\n</rss>\n","x":410,"y":700,"wires":[["4bcb0b7b.43167c","57085119.1b246"]]},{"id":"4bcb0b7b.43167c","type":"debug","z":"40bf4776.bf40b8","name":"Payload","active":true,"console":"false","complete":"payload","x":617.5000114440918,"y":663.7500095367432,"wires":[]},{"id":"21036559.3c3fb2","type":"function","z":"40bf4776.bf40b8","name":"Latest","func":"var latest = global.get('rssLuftkvalitetLatest') || {};\n\nvar items = [];\n\nfor (var key in latest) items.push(latest[key]);\n\nitems.sort(function(a, b) { return b.pubMilis - a.pubMilis; });\n\nvar lastBuildDate = global.get('rssLuftkvalitetLastBuildDate');\n\nvar feed = { feed : { lastBuildDate : lastBuildDate, items : items }};\n\nmsg.payload = feed;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":700,"wires":[["aa97037b.2062c8"]]},{"id":"57085119.1b246","type":"function","z":"40bf4776.bf40b8","name":"Type","func":"\nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/rss+xml';\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":700,"wires":[["a14ebf7b.99b6c"]]}]
Reply all
Reply to author
Forward
0 new messages