Page 1 of 2
Flatpress blog with discord webhook
Posted: Sun May 01, 2022 8:57 pm
by ScrapBlox
How would I do this?
So when a admin or I make a blog post I want it to create the post AND send a message to discord using the discord webhook system
I know how to create the discord webhook I just don't know how to send a POST request to it with some blog information
Thank you in advance

Re: Flatpress blog with discord webhook
Posted: Sun May 01, 2022 9:43 pm
by Madekozu
I don't know anything about FlatPress itself. Maybe a detour via the feed provided by FlatPress will help.
-->>
https://newbieto.com/gaming/how-to-setu ... ith-ifttt/
Re: Flatpress blog with discord webhook
Posted: Sun May 01, 2022 10:32 pm
by Tongara
Yeah, doing it as above with the RSS feed provided in Flatpress is how I have it set up on IFTTT.

- Screenshot_20220501-233031_Chrome.jpg (98.3 KiB) Viewed 26054 times
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 12:35 am
by ScrapBlox
Maybe a detour via the feed provided by FlatPress will help.
Yeah, doing it as above with the RSS feed provided in Flatpress is how I have it set up on IFTTT.
Hi thanks for the suggestion to use IFTTT but how do I setup RSS with my blog?
EDIT:

- 1.png (24.52 KiB) Viewed 26048 times
This link is going to the rss.php page
That's the error I get
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 1:00 pm
by Madekozu
That's weird - FlatPress's RSS feed is actually clean. Are you using the current version 1.2.1 of FlatPress?
Can you test your feed here? I'm afraid there's a mistake somewhere.
-->>
https://validator.w3.org/feed/
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 1:11 pm
by ScrapBlox
Madekozu wrote: Mon May 02, 2022 1:00 pm
That's weird - FlatPress's RSS feed is actually clean. Are you using the current version 1.2.1 of FlatPress?
Can you test your feed here? I'm afraid there's a mistake somewhere.
-->>
https://validator.w3.org/feed/
Ok so I just got done doing that and here is the results of it

- flatpressVersion.png (5.19 KiB) Viewed 26024 times
Version of the blog ^^^

- feedValidator.png (18.44 KiB) Viewed 26024 times
Blog feed validation ^^^
No clue what the feed validation means
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 1:24 pm
by Madekozu
I think I've got the right feed and I'm taking a closer look at it.
At the very top are three lines that aren't coming from FlatPress itself and are breaking the feed. Now we just need to figure out where the 3 lines are coming from.
Code: Select all
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Possible causes would be changes to the template or any plugins. Can you look in your /fp-interface/sharedtpls/rss.tpl to see if you happen to find the three lines at the top? If so - just get out - they really don't belong there.
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 1:29 pm
by ScrapBlox
Madekozu wrote: Mon May 02, 2022 1:24 pm
I think I've got the right feed and I'm taking a closer look at it.
At the very top are three lines that aren't coming from FlatPress itself and are breaking the feed. Now we just need to figure out where the 3 lines are coming from.
Code: Select all
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Possible causes would be changes to the template or any plugins. Can you look in your /fp-interface/sharedtpls/rss.tpl to see if you happen to find the three lines at the top? If so - just get out - they really don't belong there.
Yo thank you so much the <head> & <meta viewport> tags were in the index.php file I've removed them and IFTTT will accept the URL now

Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 1:37 pm
by Madekozu
Very nice, glad I could help.
However, I wouldn't have come across index.php - I'll have to remember that.
Re: Flatpress blog with discord webhook
Posted: Mon May 02, 2022 4:21 pm
by Tongara
Brilliant!
Hopefully the information in here will help future users~
I wonder why that was giving an error though? Maybe something for the Flatpress devs to look into.