Create topic in the future

I’d like to be able to, via the API, create a Discourse topic but not have it show up until a defined time in the future. This is really handy for things like announcement posts, so I can create a new topic to announce a thing at some point before the release of the thing, and have the forum discussion become available automatically at release time without me having to do anything. Has this sort of feature been discussed? (I did take a glance at the code, but I’m not really a Ruby guy, and I fear walking through the code and changing every single request for a topic to include “and publish_time <= now”…)

7 Likes

We would probably just create the topic hidden and have a job that unhides it if we were to build something like this.

First time I have seen this request, its quite common for blogs.

4 Likes

I like the idea, if you’d like to release an announcement at a future date. I think it has it’s uses on a forum.

It reminds me of auto-close which is insanely useful, except it is “auto-unhide” (or is auto-hide at a future date useful too? I don’t know). Maybe something to add low on your list @neil.

1 Like

To fill in a little more detail on this, the reason I want it is that when
we record an episode of a podcast, I run a script which creates a post on
our (WordPress) website and also a new post to our discourse forum (
community.badvoltage.org). The two posts link to one another. At the moment
I have to be present at release time in order to run the script because
discourse doesn’t allow me to post hidden; formerly I could run it whenever
I wanted and set the WordPress publish time to be the release time.
Obviously this is fairly niche, I accept, but a fix would be hugely useful
to me. (I fear running the script from cron in case it goes wrong.)

Scheduling a topic for the future (auto-unhide) would be really useful. Added to my list.

1 Like

Autohide in future is very useful for some kind of topics, for example, for sell topics that should be valid for predefined period of time like one month or week.

Would the Discourse plugin for Wordpress address this for you? When the Wordpress post was published, a matching topic in the Discourse forum would be created.

Although, I haven’t seen anyone mention whether that actually works or not :smile:

I’m aware the WP plugin exists, and I know some people have used it. It’s sort of oriented around integrating Discourse and WP, which I don’t want to do (I just want the two things posted at the same time), and more importantly what gets posted to Discourse isn’t quite what gets posted to WP; the WP post has links to mp3s in it and things (it’s for a podcast). I could probably hack the WP plugin so that I write the contents of the proposed Discourse post into a custom WP property and then the WP plugin uses that rather than the WP post content… but at that point I’m doing a bunch of complicated hacking anyway, so it’d be easier to just talk to Discourse myself, hence the request for a post-in-the-future API :wink:

Unless other users of the WP plugin would like your desired behavior too, in which case the work would benefit the world :wink:

Good morning -

I’m just curious if this post-in-the-future feature has been looked at, worked on, or made possible in the three years since the original posts. I’m relatively new to Discourse, but this seems like a very useful tool.

It would allow me, personally, to pre-position a post on Friday afternoon for posting early on Monday morning. Or pre-position a post for when I’m on vacation.

Thanks.

Timed re-open (automatic re-open after cooldown period of close)

Is on our roadmap for next release and when we build it we will also ensure we have timed “unhide”.

9 Likes

I’ve got a PR up for this

https://github.com/discourse/discourse/pull/4790

Here are some screenshots of the feature.

17 Likes

Really interested in this!

1 Like

It is live and working in latest :slight_smile:

11 Likes

I created a #howto for this: How to create a Timed Topic

5 Likes

Looks really great - I just installed it and am testing.

It appears to be possible to set the topic timer for a message - this actually seems like a more workable procedure to me. E.g. start a message to myself, set the timer and choose the category where it will go. But I’m not sure from the UI whether this will happen correctly. We’ll find out - I set one to be published in an hour! :clock1:

Update: the message did not convert into a topic in the specified category when published. So seems to me either the topic timer should be disabled/hidden from messages or support for it should be added so folks can do what I tried to do. Thanks!

6 Likes

Good catch @tobiaseigen :thumbsup:

Can you try out

https://github.com/discourse/discourse/commit/73180c8a19d466ce2c898efb8589fdad05a564bb

6 Likes

cool - thanks, @tgxworld!

I installed it and immediately my message with the timer set that had remained a message previously was posted to the specified category as a topic.

I also created a new message with a timer set, and it was automatically posted. Pretty slick!

5 Likes

I just tried to use it but I encountered multiple issues

Tried to apply it in a published post that acts as a banner, then:

  • When selecting the category, only some of them are shown, so im unable to set it to the same category as where it is actually published
  • I set the timer to be published next month, and I have a message saying “this topic will be published to #uncategorized in 19 days”, but it stills visible publically (incognito/anonymous session) - the banner stills shows too