Cronnit.us Milestone & Updates

Today Cronnit has reached a new milestone of over 100 registered users and 2,000 submitted posts. Yay! It still remains a free and completely open source. I have also been working on fixing a few bugs that were reported via fellow Redditors.

Originally I submitted the post via the Reddit API and if it didn’t return a URL it basically just tried again within a minute. That sucked pretty bad. This has been fixed and if the API gives an error it’s now saved and displayed to our users.

Reviewing some logs this caused some 50 or so posts queued to attempt to be re-submitted every few minutes for various reasons:

  • “that subreddit doesn’t allow text posts” — Some subreddits only allow links
  • “that subreddit only allows text posts” — Some only allow text posts
  • “you aren’t allowed to post there.” — Possibly banned from the subreddit or it’s private
  • “a url is required” — Wait, what?

That last one, “url is required” lead me to fix another bug that was quite stupid and had been causing users confusion. Multiple people PM’d me about it. Basically, they would write a text post that contained a URL and it wouldn’t get posted. Turns out I accidentally wrote a bad regular expression:

if (preg_match('#http[s]?://#i', $post->body)) {

That accidentally made posts that contained a link seem as if they were supposed to be link submissions. It should have at least contained the ^ modifier so the pattern checks if the submission starts with a URL. This has been fixed and I will be contacting all users that were effected by this bug.

Work has also been done so that you can schedule comments to be submitted to posts. Once that is finished I’ll add the ability to make it easier to crosspost, although doing this properly is a bit of an enigma since the Reddit API itself doesn’t actually document this feature. Obviously I could simply submit the same post to multiple subreddits, but I am not sure if this will give the appearance of a crosspost and I’m not even sure if users want that or not.