r/AutoModerator • [Δ] • Feb 28 '14

Update Now available for testing: wiki-configurable scheduled posts by AutoModerator

A while ago, I started setting up automatic scheduled posts for various subreddits via AutoModerator, and lately it's been becoming more and more common for subreddits to request these. Much like the "core" AutoModerator functionality originally, this has been something that I've had to set up manually, with moderators needing to contact me whenever they need anything changed.

As of today, I'm now ready to start testing a new script that will allow moderators to set up and modify their own scheduled posts through a wiki page. I'm going to be transferring some of the existing scheduled posts onto wiki pages, but I'd also like more people to help me test it out if they're interested in having scheduled posts in their subreddits.

The script will be made open-source eventually once I'm confident that it's working well, and documentation will be put up on a github wiki page much like the moderation functionality, but for now this post will be the "documentation".

Add AutoModerator as a mod

Even though the "main" functionality of AutoModerator (triggering actions with rules) is now built into reddit, the scheduled posts are not. For them to work correctly, you will need to invite /u/AutoModerator as a mod, and give it at least "wiki" permissions. If you want the scheduled posts to be stickied, distinguished, or in contest mode, you need to also give it the "posts" permission.

If you invite AutoModerator as a mod, it should automatically accept the invite within a few minutes. If it doesn't, cancel the invite and try again.

Setting up the wiki page

Configuring the scheduled posts is done on a separate page from main AutoModerator configuration. You must create a new page named automoderator-schedule, do not add these rules to the automoderator page.

Updating AutoModerator's schedule is done by sending it a private message to tell it to update, much like the moderation rules. The difference is that the PM's text should be "schedule" for the schedule, instead of "update". So if you keep a link at the top of the wiki page like most subreddits, the one at the top of the schedule page should be:

###### If you edit this page, you must [click this link, then click "send"](http://www.reddit.com/message/compose/?to=AutoModerator&subject=yoursubredditname&message=schedule) to have AutoModerator re-load the schedule from here

The schedule script is not running constantly like the main AutoModerator one is, so it may take a couple of minutes to receive a response about whether the schedule update was successful or not.

Configuring posts

Much like other AutoModerator rules, each post needs to be separated from others by a line of just three hypens, ---.

There are four variables that you should generally define for each post (3 are required):

  1. first (required): This is the date and time that you want the scheduled post to be made for the first time. The format is fairly flexible, but please try to be as explicit as you can. For example, something like this will work: Feb 28, 2014 4:00 PM, or 2014-02-28 16:00, Monday March 3 2014 1 AM, etc. If you do not specify a time zone, UTC time will be used. If you want to specify a time zone, you must do so numerically, using the difference from UTC time. For example, eastern time is currently 6 hours behind UTC, so that would be specified as -06, like: February 28, 2014 2:00 PM -06. For timezones ahead of UTC time such as CET, there must be a + in front, like +01. Do not try to specify using a time zone name like "EST", it will not work. Specifying a timezone (as opposed to converting your desired posting time to UTC) will mostly be important if you need the date to be included in the post's text/title, otherwise it's possible to end up with a different date than you were expecting.

  2. repeat (optional): This is the amount of time between repetitions of the post. It's specified by a number, and then a unit of time (hours, days, weeks, months, or years). So for example to have a post made once a week, you would use repeat: 1 week. Every 10 hours would be repeat: 10 hours, and so on. This should cover the large majority of needs, but a more advanced definition method is also available if necessary (which I won't detail yet). If you don't specify a value for repeat, the post will only be made once.

  3. title (required): The title of the post. The date/time of the post can be included in this if you like, see below for details.

  4. text (required): The text of the post. The date/time of the post can be included in this if you like, see below for details. Multi-line formatting is the same as with AutoModerator comments/messages/modmail. For example, a single-line post could be done like:

    text: This is the text of the automatic post.

A multi-line post is done by having only a | character on the first line, and then all the text of the post indented inside that:

text: |
    This is a multi-line automatic post.

    It has multiple lines.

    It also includes **some bold text**.

The following variables are also available, but are optional:

  • distinguish: Whether to distinguish the post, must be set to either "true" or "false". If not specified, defaults to true.

  • sticky: Whether to sticky the post. Can be set to "true", "false" or a number - If you use a number (for example sticky: 1), the post will replace any existing sticky in that slot (1 is the top slot). Using true will work the same as clicking the "sticky this post" link on the post - it will go into the bottom sticky slot (replacing a post that's already there, if necessary).

  • contest_mode: Whether to turn contest mode on for the post, must be set to either "true" or "false". If not specified, defaults to false.

Including dates in title/text

To include the current date and/or time in a post's title or text, include a placeholder that looks like {{date <format>}}. The "format" section should be a formatting string using Python strftime formatting. So for example, to have a post title look like: "Daily Scheduled Post - February 28, 2014", the title: definition would be:

title: "Daily Scheduled Post - {{date %B %d, %Y}}"

As mentioned above, the date/time that will be filled in here will use whatever timezone you used when defining first.

You can also display dates other than the current date by adding an optional positive or negative offset. For example, to display the date 6 days ahead, you would do {{date+6 <format>}}. The date from 3 days before would be {{date-3 <format>}}, and so on.

Example

As an example, here is the code for /r/Games's automoderator-schedule wiki page, defining two weekly scheduled posts:

###### If you edit this page, you must [click this link, then click "send"](http://www.reddit.com/message/compose/?to=AutoModerator&subject=Games&message=schedule) to have AutoModerator re-load the schedule from here
---
    first: "March 1, 2014 8:00 AM -07"
    repeat: 1 week
    sticky: true
    title: "Weekly /r/Games Discussion - What have you been playing, and what do you think of it?"
    text: |
        Please use this thread to discuss whatever you've been playing lately (old or new, any platform, AAA or indie). As usual, please don't just list the names of games as your entire post, make sure to elaborate with your thoughts on the games. Writing the names of the games in **bold** is nice, to make it easier for people skimming the thread to pick out the names.

        Please also make sure to use spoiler tags if you're posting anything about a game's plot that might significantly hurt the experience of others that haven't played the game yet (no matter how old or new the game is).

        Since this thread is likely to fill up quickly, consider sorting the comments by "new" (instead of "best" or "top") to see the newest posts.

        For a subreddit devoted to this type of discussion during the rest of the week, please check out /r/WhatAreYouPlaying.
---
    first: "March 2, 2014 8:00 AM -07"
    repeat: 1 week
    sticky: true
    title: "Weekly /r/Games Discussion - Suggestion request free-for-all"
    text: |
        /r/Games usually removes suggestion requests that are either too general (eg "Which PS3 games are the best?") or too specific/personal (eg "Should I buy Game A or Game B?"), so this thread is the place to post any suggestion requests like those, or any other ones that you think wouldn't normally be worth starting a new post about.

        If you want to post requests like this during the rest of the week, please post to other subreddits like /r/gamingsuggestions, /r/ShouldIBuyThisGame, or /r/AskGames instead.

        Please also consider sorting the comments in this thread by "new" so that the newest comments are at the top, since those are most likely to still need answers.

Please let me know if you have any questions or if anything above is not clear, so that I can work on improving the explanations.

44 Upvotes

126 comments sorted by

9

u/davidreiss666 Mar 01 '14 edited Mar 01 '14

Question: In a subreddit where self-posts are not normally allowed, would this still work? Or do they need to be allowed for this to automatically function?

11

u/Deimorz Mar 01 '14

No, they'd still have to be enabled. It might be possible for me add a function to toggle self-posts on, post, then turn it back off, but that's not something it does right now.

→ More replies (1)

4

u/johannz Feb 28 '14

Just checking, the author of the scheduled post is AutoModerator?

Only checking because that obviously affects whether the other moderators on the group can edit the scheduled post later.

5

u/Deimorz Feb 28 '14

Yes, AutoModerator will post it, so you won't be able to edit the post after it's made (though you can edit the wiki page so the next instance of the post is different).

→ More replies (1)

4

u/IceBreak Mar 01 '14

Is the ability to set posts to the first Tuesday of the month, for example, part of the advanced repeat definition yet to be detailed?

This is awesome by the way. So many possibilities.

6

u/Deimorz Mar 01 '14 edited Mar 01 '14

Is the ability to set posts to the first Tuesday of the month, for example, part of the advanced repeat definition yet to be detailed?

Yes. To use the more advanced method, you still define first, but then use rrule instead of repeat. This uses the iCalendar RFC recurrence rule format, which should be able to cover anything you could possibly need.

"First Tuesday of the month" would be done as:

rrule: "FREQ=MONTHLY;BYDAY=1TU"

Another example I've had to use it for is something like "Every Monday, Wednesday, and Saturday" where there's not an even gap between, which is:

rrule: "FREQ=WEEKLY;BYDAY=MO,WE,SA"

It's somewhat complex overall, but there are tons of examples in the RFC linked above.

→ More replies (3)

2

u/WoozleWuzzle Mar 03 '14

When AutoMod is scheduled to create a post it then doesn't check the flairing guidelines. These weekly posts are to be flaired, but the one we just tried didn't get flaired. We had to flair it manually: http://www.reddit.com/r/hockey/comments/1zg1lj/canadian_manner_mondays_march_03_2014/

3

u/Deimorz Mar 03 '14

Ah, yeah, the AutoModerator rules never check its own posts. I'll add the ability to define flair as part of the scheduled posts.

→ More replies (6)

2

u/CRASNY Mar 04 '14

Is it possible to schedule link posts?

→ More replies (2)

2

u/WoozleWuzzle Mar 10 '14 edited Mar 10 '14

For those just noticing Daylight Savings Time did not apply to your settings.

I am guessing adding an hour from your current wiki settings from all schedules will fix it.

3

u/Deimorz Mar 10 '14

Hmm, I think this is probably one of those issues where there's a difference between what makes sense to humans and what makes sense to computers.

The way it's working overall is that you have an initial post time, and then a length of time between repetitions of that post. So it's not really "post at 8 AM every Saturday", it's "post at 8 AM on this date, then wait a week and post again". The "a week" is a set amount of time that it's going to wait, and the fact that the time changed during that week doesn't affect how long it's intending to wait before posting again.

I'll have to figure out if there's some way I can address this, I think people are most likely expecting a particular time for posting, and not a particular time in between.

→ More replies (1)

2

u/david_z Mar 17 '14

I have the following scheduled in the automoderator-schedule, but the post has not appeared yet. Have I done something wrong?

---
    # Weekly new rider Q & A thread (time set using UTC/GMT without offset)
    first: "March 17, 2014 3:20 PM"
    repeat: 1 week
    sticky: true
    title: "Weekly /r/Snowboarding New Snowboarders Q & A Thread -- {{date %B %d, %Y}}"
    distinguish: true
    text: If you're a new/novice snowboarder and have questions -- any questions -- please use this thread to ask them.  This should be a place where everyone in the /r/Snowboarding community can answer questions that new snowboarders might have. This could be anything from advice on which gear to buy, whether to take a lesson, what's the next step in progression, etc.  This thread is geared towards new riders but anyone is free to ask questions and (hopefully) get as much input as possible from other riders.
→ More replies (2)

2

u/telchii Mar 20 '14

Hey Deimorz!

First off, I'm extremely grateful for this scheduled post function and AutoModerator in general! I moderate the subreddit dedicated to the game Phantasy Star Online 2 and have, after one week of using the scheduled post, had great success with it!

Each week, the servers go down for maintenance around the same time and we have typically had at least one post each week about "Why can I not connect???". (For your typical game, this wouldn't be an issue. But the game is officially only in Japanese, and the fan translation doesn't translate the error messages.) At the request/complaints of the subreddit regulars, this needed to be stopped. So, I implemented the scheduled post system to try and put a stop to these posts.

Much to my pleasure, and the pleasure of our regulars, there wasn't a single "Can't connect!!" error this week!

But now that the time for weekly maintenance has passed, the post needs to be removed. I'm fine with removing it manually each week, but it would be better if it could be removed after so much time.

So my question is: Does AutoModerator have a function to remove a scheduled post after so much time has passed? Even if this was to unsticky a post and let it sink into the regular feed.

Sorry for the wall of text and story time, but I really wanted to share!

tl;dr: Scheduled post = success. Possible to automatically remove said post after a xx time?

4

u/Deimorz Mar 20 '14

Well, there's not really an easy way to do something like that. There's a really hacky ugly method that would probably work though:

  1. Set up the scheduled post that you actually want.

  2. Set up another scheduled post that's also going to be sticked, which should be posted however much later you want the original to be taken down. So if you want it to be up for 6 hours, set this post up to be made 6 hours later.

  3. Set up an AutoModerator rule that will remove the second post, probably some combination of a check that the submitter is AutoModerator and something unique in the title.

Effectively this will make it so that the second scheduled post is made and stickied, which causes the original to be unstickied, then it gets removed right away so the subreddit appears to have no sticky.

→ More replies (1)

2

u/retractableclause Aug 11 '14

Can anyone help me figure out why this posted at 1pm and again at 2 pm? Meant to post at 1pm AST (UTC-4).

###### If you edit this page, you must [click this link, then click "send"](http://www.reddit.com/message/compose/?to=AutoModerator&subject=MultipleSclerosis&message=schedule) to have AutoModerator re-load the schedule from here
---
    first: "August 11, 2014 1:00 PM -04"
    repeat: 1 week
    sticky: false
    title: "Weekly /r/MS Good news! Share your victories - big or small!"
    text: |
        Please use this thread to share how you're doing, something you're proud of/excited about, or any other positive news you can think of.     
→ More replies (2)

16

u/MagicBigfoot Feb 28 '14

Hardest Working Man In Snoo Business!

2

u/Knowltey Mar 01 '14

I keep getting "Error updating from wiki configuration" from AutoModerator about this when updating, I even tried copying and pasting your example and it still doesn't want to play?

Says "Invalid condition in section #1 - Invalid variable: text"

4

u/Deimorz Mar 01 '14

You're putting it in the automoderator page and not a separate automoderator-schedule page.

→ More replies (1)

1

u/scottymtp Mar 02 '14

Can you set it to initially sticky false, then change sticky to true at a later date?

My use case:

  • Ballot Voting Thread open 1 week every 2 weeks.

  • Ballot Proposal Thread every 2 weeks.

Need proposal thread automatically stickied during its second week once polls close.

2

u/Deimorz Mar 03 '14

No, it's just the initial posting that can be scheduled.

1

u/Grimzentide Mar 03 '14

Feature Request: A way to implement a 1 scheduled off post.

3

u/Deimorz Mar 03 '14

You could just put a very high repeat, like "10 years".

→ More replies (4)

1

u/Kuenaimaku Mar 03 '14

Hey, getting an error with the text bit when trying to submit it. Here's what we have:

-- first: "March 10, 2014 12:00 AM -07" repeat: 1 week sticky: true title: "Warframe Weekly Q&A | Ask Your Game-Related Questions Here!" text: | Hello there Tenno! This thread was created for the purpose of those who aren't that knowledgeable about the game to freely ask questions and get answers. Questions will be answered any day of the week!

This place will be a troll-free environment, so that anyone can ask a question without backlash. In other words: **Negative Attitude will NOT be tolerated.**
 
___
If you wish to just view top level comments (i.e. questions) add **?depth=1** to the end of the page url.
___
REMEMBER TO SCROLL DOWN TO THE BOTTOM AND CHECK OUT THE QUESTIONS FROM THOSE WHO WERE LATE TO THE THREAD PLEASE :D

Or use Reddit's NEW filter! And remember...

###Questions will be answered any day of the week!

It gets stuck on the first asterisk every time, and I thought that formatted text was fine. What am I doing wrong?

→ More replies (2)

1

u/Seraph_Grymm Mar 03 '14 edited Mar 04 '14

Sorry to bother, I know you're busy. Doesn't seem to work, or is there a lag right now because all of the users trying this?

first: "March 03, 2014 5:55 PM -06"
rrule: "FREQ=MONTHLY;BYMONTHDAY=+1,+14"
sticky: true
contest_mode: true
distinguish: true
title: "[MOD]Critique Thread {{date %B %d, %Y}} - Feedback requests go here!"
text: |
    Rules:   

    - ***UPVOTE THIS THREAD IF YOU PARTICIPATE*** If you dont like it, there is a link below to message     us, but show support if you do like it, keep it on the front page!  

    - OC content only!  

    - Poem must be posted directly in the comments (not linked to).  

    - Please do **not** also post in the sub (redundant clutter). If you already have, try not to do it again (and remove the post if possible).   

    - If you post a poem here, it is required that you **FIRST** comment on another person's poem /leave feedback on a piece **IN THIS THREAD**. It cannot be a one sentence "I like this poem." The success of this project is determined by **YOUR** activity and help!  

    - Be patient, any poem in here before the cut off time will get a response by end of day XXXX if not responded to by another member.    

    - ***BE KIND AND RESPECTFUL and as thorough as possible***      

    - ANYONE CAN CRITIQUE. If you can read, you *must* know what you like. Provide feedback, we know it's just your opinion and that little bit goes a long way into creating a stronger /r/poetry. Very few of us are writing pros, so jump right in!  


    Note: If you have any questions/concerns/suggestions [click here](http://www.reddit.com/message/compose?to=%2Fr%2FPoetry&subject=Suggestions%20For%20Critique%20Thread&message=This%20is,%20where,%20you%20put%20suggestions!%20Yay!), do not leave them in these comments. 

2

u/Deimorz Mar 04 '14

What isn't working about it?

→ More replies (5)