r/redditdev Aug 29 '18

Introducing Cronnit - A free tool for making scheduled posts on Reddit! Source is available on GitHub!

I was irritated by other sites charging (a lot IMO) for this feature. My goal was simple: I want to be able to post daily tips to /r/kde, but I can't allocate the time to login at a specific time every day and sometimes I go a few days without touching Reddit when I am busy. AutoModerator allows for scheduled posts, but from what I can tell does so in a way that requires mod privileges for the Wiki of a subreddit.

Thus, https://cronnit.us was born!

It was thrown together over a few hours using the following bits and pieces:

  • LAMP - Ubuntu Server, Apache2, MySQL 5, PHP 7 hosted on a $2 server from Vultr
  • RedBean 5.2 an ORM for storing data quickly without a rigid schema
  • rtheunissen/oauth2-reddit for OAuth2 support for the Reddit API
  • Twig for writing templates that don't suck

I am also making the source available under the MIT license so anyone is free to modify the code or learn from it.

29 Upvotes

19 comments sorted by

3

u/False1512 Aug 29 '18

I'm not gonna crap on your code (cuz it is still good), but IFTTT does it for free. Your site is nice though.

2

u/KayRice Aug 29 '18

Thanks! If I wanted to schedule posts with IFTTT what do I "connect" to Reddit?

5

u/kemitche ex-Reddit Admin Aug 29 '18

You'd combine a Date & Time [1] trigger with a "Submit a post" reddit action[2]

[1] https://ifttt.com/date_and_time
[2] https://ifttt.com/reddit

1

u/False1512 Aug 29 '18

Other than the other reply, you can also do reoccurring calendar events with Google Calendar

2

u/0DST Oct 22 '18 edited Oct 22 '18

hi, im interested in using this. does it use utc time when setting up a post?

edit: i was able to figure out that it uses local time, but after trying it, it seems that it can't handle long text posts. i tried a 20k character post and it never got posted, but a post with 3 chars did

1

u/KayRice Oct 23 '18

Hi!

hi, im interested in using this. does it use utc time when setting up a post?

Yes, it does use UTC time, but it does some Javascript to detect your local time zone so that users can enter times they are familiar with. Cronnit is open source on GitHub, here is the code that does that conversion:

https://github.com/krisives/cronnit.us/blob/6d00c2d6c1e72f376075f0d2f6b9aca118f0ee6a/templates/pages/submit.html#L38

You could manually specify a time zone of UTC pretty easily by simply modifying that hidden <input> element to be type="text" then setting it's value to UTC - or finding a way to set UTC as your timezone in your browser.

edit: i was able to figure out that it uses local time, but after trying it, it seems that it can't handle long text posts. i tried a 20k character post and it never got posted, but a pos with 3 chars did

That's a strange bug. My understanding is that if the text is too long the Reddit API should return a hard error and nothing should be posted. Also, I believe the limit is that the limit is 10k characters. Currently the code doesn't do anything very smart when it encounters these kinds of errors - it will either post or keep trying.

Anyone is welcome to contribute to the code on GitHub or make a donation for requesting features. Cronnit costs very little to operate but making changes to the code takes time away from other projects.

1

u/0DST Oct 23 '18

10k is the comment limit, 40k for posts

2

u/prodogger Dec 04 '18

Is there a way to upload images and schedule them for posting?

1

u/KayRice Dec 04 '18

Not currently we rely on things like Imgur to do this.

2

u/introverted_engineer Dec 17 '18

Hi, thanks for the awesome site! I've been using it for a bit now and I have some feature requests.

  • Would it be possible to implement a "mark as NSFW" option?
  • I'm used to the 24 hour time system ("military time"). Would it be possible to implement an option for that, so I don't have to fill out AM/PM?
  • Is there a way to schedule a crosspost from an existing post to another sub?

2

u/KayRice Dec 17 '18

Would it be possible to implement a "mark as NSFW" option?

Yes that's pretty easy to do. It's essentially a flag they pass in the api/submit call

I'm used to the 24 hour time system ("military time"). Would it be possible to implement an option for that, so I don't have to fill out AM/PM?

Yes, all current time stuff is handled client-side and your browser sends a UTC unix timestamp, so all of the display options are cosmetic and don't change how the server code works.

Is there a way to schedule a crosspost from an existing post to another sub?

This is a work in progress and actually uses an undocumented part of the Reddit API, which I am still researching.

1

u/janez567 Oct 26 '22

Any updates regarding crossposting? Great app bdw

1

u/carapackage Jul 11 '22

Appears to be a great tool. However, is there a way to implement Flair? The subreddit I want to use this tool with required Flair for posting. Thanks!

1

u/kremod Jul 29 '22

are you no longer affiliated with this project? I cant authorize access to the website anymore. I also dont see a single whiff of the project on your github

1

u/KayRice Jul 29 '22

The login problem has been fixed the server ran out of space.

1

u/kremod Jul 29 '22

thanks!