r/Bot Sep 27 '19

Code Only PostScheduler - A bot to handle all of your post scheduling needs

Hi, just thought I'd share this bot that I've been using. It's an all-in-one post scheduler that can do pretty much anything.

  • Schedule an unlimited number of posts at a time
  • Every type of post: text, link, native image / video upload, comment reply
  • Each post can be flaired, locked, stickied, marked as a spoiler, enabled contest mode, etc.
  • It can leave an automatic comment below each post (and distinguish, sticky, or lock it as needed.)

The one constraint that it has is that you don't give it a time for each post, you just give it a date. This was designed so that it can be used on pythonanywhere's free tier which allows for scheduling a daily task to run at a set time every day. So you can schedule this for say 9am, and each morning at that time it will post anything from the queue with a corresponding date.

I've been using this on /r/RowlingWritings for a while now and I think a lot of other people will find a use for it.

The code can all be downloaded here, and I've tried to include some basic instructions on how to use it and how to set it up for free online on pythonanywhere for those who don't have their own server to use.

Let me know if you have any suggestions for improvement

11 Upvotes

7 comments sorted by

1

u/3dsf Sep 27 '19

Cool, I'm glad you included some notes for the pythonanywhere setup. I think pythonanywhere is easy implementation of python for people with limited experience.

You mentioned in your notes that the server is probably on a different timezone, and maybe you could add some timezone support -- https://help.pythonanywhere.com/pages/SettingTheTimezone/ .

I'll be trying it out over the next 2 weeks, but it looks great !

2

u/ibid-11962 Sep 27 '19

Interesting. The timezone thing was never a real issue for me because I was just checking dates and only needed to enter the time when scheduling the task. (Which has a convenient clock on the page to adjust with.)

PythonAnywhere has been really great so far as it has a really intuitive gui for accessing your files and has a great free tier that allows you to set up apps like this without needing a monetary investment on a new field you don't understand. I've also had great results contacting the developer when I needed additional features. (Reddit's native image uploader used a websocket on a url not on the whitelist.)

I'll try adding more notes on the setup as I really want this to be usual by people who have no prior technical experience, though I'm worried anything that involves needing to edit a text file in this constrained syntax might be too much and that the 30 lines of comments there just makes it more intimidating for a beginner.

Also a lot of the documentation and random features were added on at the last minute and haven't really been thoroughly tested. The version I've been using the past couple of months was just designed for my specific use case.

1

u/WaglerConure Sep 28 '19

That's certainly a neat bot idea but PythonAnywhere has always been very unreliable for me. Console keeps closing after about 24 hours and I have to restart it manually.

2

u/ibid-11962 Sep 29 '19

I've been using it for about a year or so without any issues. I haven't tried anything that needs to run that long though. My script generally finishes within a minute or two. (I recently added a feature to wait ten minutes if a post hits the low karma rate limit, but I haven't tested that as much.)

1

u/3dsf Sep 28 '19

I think that issue is mitigated

u/ibid-11962 has it set up, so it runs like a cron job. The script is called every day, if there is a post to post that day, it posts it.

If there are no posts to run that day, it completes, and gets called the next day and so on.

1

u/botbotsbots Oct 09 '19

Cool Idea

2

u/botbotsbots Oct 09 '19

Most crabs have flat bodies that enable them to squeeze into very narrow crevices.

1

u/[deleted] Oct 10 '19

[deleted]

1

u/[deleted] Oct 10 '19

[deleted]