Monthly Archives: February 2010

MySQL auto-Tweet

While running thebandmind.com, I thought it would be fun to have a Twitter account which automatically is updated twice a day with a random quote from the database of quotes. This Perl script is run from Cron.

MySQL Database:

CREATE TABLE IF NOT EXISTS `quotes` (
  `ID` int(10) unsigned NOT NULL auto_increment,
  `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP 
    on update CURRENT_TIMESTAMP,
  `twitter` varchar(140) default NULL,
  `tweets` int(5) NOT NULL default '0',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

Read more »