# How can i make a flow that checks for RSS feeds and then posts on Discord (via Webhook)?

**URL:** <https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118>\
**Category:** General\
**Tags:** http-request, dashboard\
**Created:** [26 May 2022 20:13 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118 "2022-05-26T20:13:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [27 May 2022 23:57 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/21 "2022-05-27T23:57:37Z")

</div>

Thanks. Tried your advice.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/060d7223788051ffa4b72c41873c1a8dba842c41.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/4357eb9413e25977aaaa4f1b84eef55176028d4a.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8d396f611a2b3fa0791a3d88bfe76c196e6c2e0a.png)  
Click Deploy...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5f4b3c7e0792ae55e3e4451b5d95951a096ccc72.png)  
...still sends the whole object (and process once).

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 May 2022 23:59 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/22 "2022-05-27T23:59:49Z")

</div>

> [@vico](#):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/4357eb9413e25977aaaa4f1b84eef55176028d4a.png)

Wrong way around

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39553d4189f20cdc9277810b0540e21712877af8.png)

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [28 May 2022 00:01 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/23 "2022-05-28T00:01:22Z")

</div>

..this?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1ca6c1f0c1af979c4d3b4a777f906f0777b30110.png)

---

<div class="post-metadata">

**Author:** ![supermamon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/supermamon/32/62258_2.png) [@supermamon](https://discourse.nodered.org/u/supermamon)\
**Post date:** [28 May 2022 09:10 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/24 "2022-05-28T09:10:52Z")

</div>

Joining here from the [Reddit thread](https://www.reddit.com/r/selfhosted/comments/uzbdl0/is_there_other_selfhosted_and_intuitive/).

To loop through the rss items, you can use the [node-red-contrib-loop-processing](https://flows.nodered.org/node/node-red-contrib-loop-processing) node like below.

**Flow**

 ![CleanShot 2022-05-28 at 16.51.25@2x](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b1189c428b622aa7102bb2fe6618666c03b6bdf.png)

...more

---

<div class="post-metadata">

**Author:** ![supermamon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/supermamon/32/62258_2.png) [@supermamon](https://discourse.nodered.org/u/supermamon)\
**Post date:** [28 May 2022 09:11 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/25 "2022-05-28T09:11:48Z")

</div>

...continued

_have to break the post since I'm new here_

**set msg.array**

 ![CleanShot 2022-05-28 at 16.58.41@2x](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/261b40ddd2f07e2f6b87755b7d38c220faa983f4.png)

**array-loop**

 ![CleanShot 2022-05-28 at 16.59.59@2x](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/4643825641634b50aaa30625e03bf14c1cb7ba04.png)

...more

---

<div class="post-metadata">

**Author:** ![supermamon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/supermamon/32/62258_2.png) [@supermamon](https://discourse.nodered.org/u/supermamon)\
**Post date:** [28 May 2022 09:12 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/26 "2022-05-28T09:12:24Z")

</div>

...continued

**loop body**  
This is where you process every item. `msg.payload` will be the actual item from the array.

 ![CleanShot 2022-05-28 at 17.05.39@2x](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1e0d4f05a8c891a76b2da6b2f71d1213c5d056d3.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 May 2022 09:17 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/27 "2022-05-28T09:17:09Z")

</div>

There is no need for a contrib node & looping is ill advised (for risk of infinite loop)

The split node is all you need.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 May 2022 14:02 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/28 "2022-05-28T14:02:59Z")

</div>

Just checking the code for the feedparser node.

It could easily be amended to spit out a message per article.

Also, it could probably output JavaScript objects rather than XML which would be a lot better for most people.

From there, it could probably be amended to only emit new/amended articles rather than emitting everything each time.

They would be options of course to ensure backwards compatibility.

It is a pretty simple node so would make an easy starter project for someone.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 May 2022 14:17 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/29 "2022-05-28T14:17:45Z")

</div>

> [@vico](#):
>
> Unfortunately feedparser seems to not process each feed entry into a JS object to access those properties. Seems to just output each entry's XML raw code.

OK, I need to test, looking at the feedparser code, it appears to be capable out outputting each article individually at least. There are other libraries that do output JSON directly as well.

Personally, I would also like to find a better way to handle both incoming feeds and feed merging & republishing. Not been using feeds so much over the last couple of years, partly due to the limited good options for offline aggregation/reading with a complete article not the truncated ones so many feeds produce. And partly because I'm no longer regularly travelling by public transport.

I greatly miss Yahoo! Pipes which made feed manipulation really easy. Really, it should be possible to reproduce some of those features in Node-RED.

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [28 May 2022 14:36 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/30 "2022-05-28T14:36:55Z")

</div>

Thanks for the concise explanation. I will try to reproduce this flow here in my instance.

> [@supermamon](#):
>
> ![CleanShot 2022-05-28 at 16.59.59@2x](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/4643825641634b50aaa30625e03bf14c1cb7ba04.png)

In that part, why is Key Variable defined in that way (msg.alf99226....)?

> [@Steve-Mcl](#):
>
> There is no need for a contrib node & looping is ill advised (for risk of infinite loop)
> 
> The split node is all you need.

Excuse my sincerity, but I'll follow his example at first simply because he was more clear and illustrative about how trying to make that work with loop nodes. I didn't really understand your explanation using split node.

If there was an example similar to his (with images, a concrete example, etc), but with split node, it would facilitate my comprehension (remember that i'm newbie in Node-RED)...

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [28 May 2022 14:37 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/31 "2022-05-28T14:37:42Z")

</div>

> [@TotallyInformation](#):
>
> It could easily be amended to spit out a message per article.

But... **how**? I need an example flow about how i could achieve that.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 May 2022 15:54 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/32 "2022-05-28T15:54:09Z")

</div>

> [@vico](#):
>
> > [@Steve-Mcl](#):
> >
> > There is no need for a contrib node & looping is ill advised (for risk of infinite loop)
> > 
> > > The split node is all you need.
> 
> Excuse my sincerity, but I'll follow his example at first simply because he was more clear and illustrative about how trying to make that work with loop nodes. I didn't really understand your explanation using split node.

Here is an example

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/508be3c8df3f833024850112342745ff771885fe.png)

Demo Flow (with fake discord webhook)

```auto
[{"id":"6523be4cd6ad3b7b","type":"function","z":"ab64ded2af71d680","name":"format item","func":"msg.payload = {\n content: msg.payload.description[0],\n title: msg.payload.title[0],\n link: msg.payload.link[0],\n guid: msg.payload.guid[0],\n pubDate: msg.payload.pubDate[0],\n creator: msg.payload[\"dc:creator\"][0],\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2010,"y":180,"wires":[["31e0f0a9064d2468","05568558b0ef648e"]]},{"id":"0935a26242e12522","type":"inject","z":"ab64ded2af71d680","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1660,"y":100,"wires":[["3c7c1ee8da1f377e"]]},{"id":"3c7c1ee8da1f377e","type":"http request","z":"ab64ded2af71d680","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://feeds2.feedburner.com/canaltechbr","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":1830,"y":100,"wires":[["d861c7895ea1a567"]]},{"id":"10a057bd40734f89","type":"debug","z":"ab64ded2af71d680","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2190,"y":100,"wires":[]},{"id":"800ea657428c94d3","type":"change","z":"ab64ded2af71d680","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.rss.channel[0].item","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":180,"wires":[["07de5594d5f3359c"]]},{"id":"07de5594d5f3359c","type":"split","z":"ab64ded2af71d680","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1850,"y":180,"wires":[["6523be4cd6ad3b7b"]]},{"id":"31e0f0a9064d2468","type":"debug","z":"ab64ded2af71d680","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2190,"y":180,"wires":[]},{"id":"d861c7895ea1a567","type":"xml","z":"ab64ded2af71d680","name":"","property":"payload","attr":"","chr":"","x":1990,"y":100,"wires":[["10a057bd40734f89","800ea657428c94d3"]]},{"id":"21a58233a74d0d36","type":"http in","z":"ab64ded2af71d680","name":"","url":"/fake_discord_webhook","method":"post","upload":false,"swaggerDoc":"","x":1800,"y":360,"wires":[["ef14c51c7057a935"]]},{"id":"3ee0a2dc1762bf32","type":"http request","z":"ab64ded2af71d680","name":"post to discord webhook","method":"POST","ret":"obj","paytoqs":"ignore","url":"http://localhost:1880/fake_discord_webhook","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{},"x":1970,"y":260,"wires":[["e4227aab1d8a63bd"]]},{"id":"8434c1b401af6b6f","type":"http response","z":"ab64ded2af71d680","name":"","statusCode":"","headers":{},"x":2190,"y":360,"wires":[]},{"id":"e4227aab1d8a63bd","type":"debug","z":"ab64ded2af71d680","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"statusCode","statusType":"msg","x":2190,"y":260,"wires":[]},{"id":"ef14c51c7057a935","type":"function","z":"ab64ded2af71d680","name":"prepare reply data","func":"msg.payload = {\n result: \"success\",\n title: msg.payload.title\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2030,"y":360,"wires":[["8434c1b401af6b6f"]]},{"id":"05568558b0ef648e","type":"delay","z":"ab64ded2af71d680","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1750,"y":260,"wires":[["3ee0a2dc1762bf32"]]}]

```

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [28 May 2022 15:56 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/33 "2022-05-28T15:56:06Z")

</div>

Thank you so much! I will try that asap!

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [28 May 2022 17:58 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/34 "2022-05-28T17:58:35Z")

</div>

I imported your demo flow, just changing the fake webhook url to a real one and the rss feed to [Lorem RSS](https://lorem-rss.herokuapp.com/) (to try to test with a highly changing feed) and got some JSON parse errors like in the image:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/b/cbf5d7864d70d59ce415b3c83a1d545cdaeacb6b.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 May 2022 19:57 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/35 "2022-05-28T19:57:11Z")

</div>

Set the faulting http request to return a string instead of parsed JSON and you won't get an error.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 May 2022 22:31 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/36 "2022-05-28T22:31:13Z")

</div>

> [@vico](#):
>
> > [@TotallyInformation](#):
> >
> > It could easily be amended to spit out a message per article.
> 
> But... **how**? I need an example flow about how i could achieve that.

Give me a chance! 😸 You can't make the current node do it as it isn't written that way. I started to prepare a test node but totally sidetracked myself by setting up a new [GitHub repo](https://github.com/TotallyInformation/node-red-experimental-nodes) that will let me more easily do experiments like this. It also has some build tools (which is what took me so long to get working, the whole evening).

Now I have it ready and installed, I can copy the core feedparser node and experiment with it.

Hopefully it will also be useful to other people who want to get started on creating new nodes.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 May 2022 00:21 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/37 "2022-05-29T00:21:45Z")

</div>

Right, so it seems that my memory is even worse than I thought!

I've reproduced the node-red-node-feedparse node and it does, in fact return a msg for each article in a fetched feed.

`msg.pubDate` contains the timestamp of when the article was published and so you should be able to filter on that using a change node.

Sorry about the earlier mislead. Too tired to sort out the remaining logic tonight. May have a go tomorrow.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95592f6d9f42f290497c1b13af22fdb156f4c621.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/032fe7c7a163c9318b4199427ed20b2704ed9b88.png)

---

<div class="post-metadata">

**Author:** ![vico](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vico/32/62181_2.png) [@vico](https://discourse.nodered.org/u/vico)\
**Post date:** [29 May 2022 02:30 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/38 "2022-05-29T02:30:23Z")

</div>

Thank you so much for this examples!

EDIT: I noticed that your feedparser node had a entry point (point at left), that the feedparser node that i installed (`node-red-node-feedparser`) didn't had.  
Got intrigued and searched for feedparser in the Manage Pallete "store". Ends up that there is some "forks" of this node available as well, and some have the left point like the yours.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/1784e8b67215515ecbe0ba48e2db7183805bbdd9.png)

So... what feedparser node you tested exactly?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 May 2022 11:27 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/39 "2022-05-29T11:27:19Z")

</div>

> [@vico](#):
>
> EDIT: I noticed that your feedparser node had a entry point (point at left), that the feedparser node that i installed ( `node-red-node-feedparser` ) didn't had.

Ah, I meant to mention that but it was late and I forgot. That was because I wanted to be able to trigger it manually. So I hacked that into my test version. To be honest, it doesn't make a lot of difference. The library that is used actually takes into account a cache so you have to restart node-red anyway if you want the full feed gain.

The test version is available in [TotallyInformation/node-red-experimental-nodes: An occasionally changing set of experiments for Node-RED (github.com)](https://github.com/TotallyInformation/node-red-experimental-nodes) if you want to try it. You will need to install from the command line though:

```auto
cd ~/.node-red
npm install totallyinformation/node-red-experimental-nodes

```

As mentioned, that is my new experiments package so nodes will come into and go out of it over time.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 May 2022 15:28 UTC](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118/40 "2022-05-29T15:28:35Z")

</div>

> [@vico](#):
>
> node-red-contrib-discord-advanced

Got rid of that and installed the core node-red-node-discord node instead. Seems to work perfectly.

Connected the discord message send node to the output of the feedparser node and it just worked.

So now I'm a bit confused as to what you actually want to achieve since the basics work as anticipated.

Could you clarify?

[Previous page](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118.md?page=1)

[Next page](https://discourse.nodered.org/t/how-can-i-make-a-flow-that-checks-for-rss-feeds-and-then-posts-on-discord-via-webhook/63118.md?page=3)
