Cronless - Free Cron Jobs
 

Blog



Posts Tagged ‘php’


Tip: Cronless Can Schedule Tweets

Monday, November 16th, 2009

I found a great service called ScheduledTweets that works perfectly with Cronless–a scheduling service for your Twitter account.

Some info from the site:

—————

ScheduledTweets is built with PHP, uses MySQL to store the data & its interface is fully Ajaxed.

It enables you to define time-intervals which your tweets will be sent every x minutes. You can enter unlimited tweets, drag’n drop your tweets to change the order they will be sent.

Also, URL shortening service TinyURL is integrated for shorter tweets.

ScheduledTweets comes with a web-based friendly installer that helps you define database & Twitter information easily.

Why Use ScheduledTweets?

Twitter is both an instant messaging & a micro-blogging platform. You will probably not schedule your personal tweets (I won’t, as it clearly becomes meaningless) but if you are regularly sharing stuff on a subject, then it has the same benefit as scheduling a post on a blog.

Installation couldn’t be simpler:

  • Create a MySQL database & user
  • After downloading it, unzip the files to a folder & upload them to your hosting account
  • Run http://www.yourdomainname.com/scheduled-tweets-url/index.php
  • Define the MySQL database information you created in the first step. Also define your Twitter info and desired ScheduledTweets admin info
  • Click install
  • Setup a cron job to http://www.yourdomainname.com/inc/functions.php?getAction=cronTweet (the interval must be lower than your smallest interval defined in ScheduledTweets)
  • Click “Start ScheduledTweets” button at the top menu
  • That’s it

—————

I personally recommend using Cronless’ free cron jobs to schedule those tweets!  ;)

Tips Creating Your Jobs

Thursday, October 15th, 2009

It’s quite possible that you may get timeouts when your PHP cron job runs.  If that happens, place this at the top of your script

<?php
set_time_limit(0);    //0 = run forever
?>

This will allow your script to run to completion, ignoring timeouts.  Jobs executed here at Cronless are run under this directive, but your own web server may timeout if you fail to put that in as well!

If you find that this isn’t enough and you still get timeouts (some hosts are disabling this PHP function), you can help by limiting your script output as much as possible.  (less than 4kb is ideal)