I am nearing completion of another Facebook Development Project.
After 10 years with this domain, which I originally started to manage the Information Architecture list I ran (which had a whole bunch of traffic at one stage) it’s time to move on.
So this is the end.
And a new beginning.
And funnily, there is not much difference between the two:
Top Secret Project now lives at:
So … where is the PHP equivalent of Django Admin? Or the multitude of Rails Admin plugins?
I don’t care what framework it sits on as long as the out-of-the-box functionality is awesome.
Been very quiet, but I have been working a lot, among other things.
I am happy to announce the launch of my latest Facebook Application: Telstra HeroMessage. You can read all about it at the Telstra HeroMessage® Facebook Application About Page.
I am pretty excited about it, a massive national media campaign is already underway.
Is all I think about
I’ve just released the first pass of a Ruby on Rails Plugin called Acts As Scheduled.
acts_as_scheduled allows you to manage scheduled events for your models.
A good example of this is scheduling the update of RSS Feeds in a background process using Cron or BackgroundRB.
With acts_as_scheduled your schedule manager can simply call “Model.find_next_scheduled()” to grab the next item from the database.
At the moment it assumes you are working with MySQL.
All you need to get started is to add two extra columns to your table:
frequency is the number of seconds for your schedule.
last_scheduled is the date and time the record was last processed.
Ruby on Rails is real smart with times, so you don’t have to worry too much about calculating frequency values:
model.frequency = 1.day
model.frequency = 1.minute
model.frequency = 10.second
In your model class your simply declare “acts_as_scheduled” and you now have two extra methods find_next_scheduled and schedule_complete.
Returns the next scheduled record from the table.
The next scheduled record is calculated as “the record who’s last_scheduled value is less than the current time minus the specified frequency in seconds”.
Which is the complex way of saying “if freqency is 1 minute, return the record if it was last_scheduled more than 1 minute ago”
If there is more than one record, records scheduled to occur more frequently will be handled first (so records with minute schedules are returned before records with daily schedules.
Sets the record’s last_scheduled value to Time.now
class ScheduledItem < ActiveRecord::Base
schedule_minute = ScheduledItem.new(:frequency => 1.minute, :last_scheduled => 2.seconds.ago)
schedule_day = ScheduledItem.new(:name =>”day”, :frequency => 1.day, :last_scheduled => 25.hours.ago)
#returns thing_day because it was last_scheduled 25 hours ago
schedule_day = ScheduledItem.find_next_scheduled