Fill in post for user?

(Peter N Lewis) #1

I looked at the API, but I don’t think it will do what I want (for one thing it requires the user to create an API key which isn’t going to be practical).

What I want to do is have a way for my Mac application (Keyboard Maestro) to allow users to post content (from the application) to the forum. So the user selects a chunk of content, and clicks a button, and the forum opens up with the New Topic fields filled in (category, subject, content, including an uploaded file). The user can then edit the post as they desire before posting it.

Ideally, if the user is not logged in, they would be prompted to login/create an account first, but I could accept that they simply have to be logged in first.

Is there any way to accomplish something like this?

Using the Discourse API to post with uploaded files?
(Jeff Atwood) #2

Aren’t you referring to the URL that pre-fills a topic, title, etc? @techapj worked on this, and it now exists.

(Peter N Lewis) #3

Yep, that is close to what I am after. It would be good if it survived the login process if the user is not yet logged in, but it doesn’t currently

I don’t see how it can be extended to support a file (or image) upload though, so that may be a problem.

Can images/files be uploaded separately via the API? I (obviously) can’t store the master key in the application, but I could probably do something where the application uploaded the file to a web service I define, which in turn uploads it to the forum, and then have the topic body reference that uploaded file. A bit ugly, but perhaps doable. Does the API allow uploading files?

(Jeff Atwood) #4

Any way we can get this to survive login, @techapj?

(Arpit Jalan) #5

Fixed via:

(Peter N Lewis) #12

Yep, sorry, that got dropped when I undid the previous patch.

Excellent, that all works perfectly now, including the upload of the images/files.

I’ll try to post a quick demo of how awesome this now is.

(Peter N Lewis) #13

OK, I can’t upload videos to this site, but here is a short video showing just how cool this integration is, combined with the synchronous uploading files (thanks @zogstrip!) from Using the Discourse API to post with uploaded files?. This link probably wont last forever, but I’ll keep it alive for a fair while.

(Kane York) #14

There’s a website where you can upload videos and they’ll keep it around for a while :wink:

(system) #15

(Erlend Sogge Heggen) #16