[PAID] Auto create new topic when I publish a video on YouTube


(Leo B) #1

Am looking for a solution to automate this:

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.

Thanks!


(Joe Buhlig) #2

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.


(Dean Taylor) #3

IFTTT has a YouTube trigger for “New public video uploaded by you”:
image

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:

See:


#4

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.


(Vinoth Kannan) #5

It already discussed above. If you are unable to link Youtube => IFTTT => Discourse then I can help you.


(Leo B) #6

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.

URL format used:

http://mydiscourseinstallation.de/posts/?api_user=USER&api_key=KEY&title=Title&topic_id=title&raw=Content&category=1

Am I doing it wrong, or is something misconfigured on my server?


(Leo B) #7

Update: Got it fixed.

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.

Category IDs (for specifying where the post should go) I found here:
http://mydiscourseinstallation.com/site.json

Zapier setup looks like this:

All other fields I could leave as they were.

Works like a charm now! Thanks guys.


Communities at the research-practice interface ("breaking the ivory tower")
#8

Glad you got it sorted. Didn’t get a chance to log in and check my settings. Need to to put the youtube one in place now.


(Makary ) #9

Alternatively you can just use plugin built to post on :discourse: based on YT rss feed? It should be faster to samo extent, and wouldn’t need any external dependencies.


(system) #10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.