I’ve got a YouTube channel. A new video is published every couple of days. Now the people on my forum say that it would be great if those videos were also on the forum, so that the videos could function as conversation starters and could be discussed on the forum among the members.
So I’d need to have a new topic generated in Discourse whenever a new video is published on my YouTube channel. Topic title would be “[Titel of YouTube Video] (YouTube)”. Body would be simply an embed of the video itself. And these auto-generated topics should all go into one specific category of my Discourse forum.
Has anyone done this before?
Can anyone code this for me (for a fee, for course)?
Or else do you have ideas how this could be done?
My own thoughts on this so far: With WordPress, I could do this simply with a service like Zapier or IFTTT. But, as far as I know, none of these services integrate directly with Discourse to create new topics. I think there are plugins for Wordpress that can post to Discourse. And perhaps one could build kind of an assembly line, where YouTube feeds to Zapier, Zapier feeds to Wordpress, and Wordpress feeds to Discourse. But I’d prefer having something more direct, with fewer moving parts that can break. Would gladly pay for such a solution, too.
Have you tried tying Zapier to an RSS feed and using webhooks in Discourse? That’s likely how I would try it to start. That way you’re not worrying about a custom plugin and the cost associated.
IFTTT has a YouTube trigger for “New public video uploaded by you”:
This coupled with a “then” of send a Gmail email to your Discourse instance where a category has a custom email address which posts the content would likely work well:
Wouldn’t even need the email in. You can use the Api and post it through that. I have set up a number of posts through zapier. Good idea actually to set up a YouTube one. Think that’s a task for Monday.
Thanks guys! Great suggestions. To use the API sounds like a great idea.
Thanks also for the link to the tutorial, @vinothkannans.
For some reason, Zapier gets a server error 403 when trying to send data via POST to mydiscourseinstallation.com/posts. And when I call the same URL using GET parameters, my browser shows me a server error 500.
Needed to use API key from specific user, not the general API key. To configure, click your user image in the top left, click the gear for “Preferences”, click “Admin”, and then set up an API key there.
Alternatively you can just use plugin built to post on based on YT rss feed? It should be faster to samo extent, and wouldn’t need any external dependencies.