Difference between revisions of "MM-Tweeter"

From MidsouthMakers - Memphis Area Hackerpace
Jump to navigation Jump to search
Line 3: Line 3:
 
* Running via CLI PHP
 
* Running via CLI PHP
 
* Design an application to use Matt Harris' library as a function to auto tweet events based on existing conditions
 
* Design an application to use Matt Harris' library as a function to auto tweet events based on existing conditions
 
 
  
 
==Current Functionality==
 
==Current Functionality==
Line 10: Line 8:
 
* Able to be run from the command line to post static tweets.
 
* Able to be run from the command line to post static tweets.
 
* Able to be run from a url to post static tweets.
 
* Able to be run from a url to post static tweets.
 +
* Checks pending table and checks if their post date < current time
 +
 +
==To Be Done==
 +
* Need to handle adding to pending table
 +
* Need to handle adding to history
 +
* Need to handle Remove from pending
 +
* Cron local system to test for pending tweets
  
 
==Goals==
 
==Goals==
Line 22: Line 27:
 
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
 
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
 
`content` VARCHAR( 160 ) NOT NULL ,
 
`content` VARCHAR( 160 ) NOT NULL ,
`post_date` DATE NOT NULL ,
+
`post_date` datetime NOT NULL ,
 
`added` TIMESTAMP NOT NULL ,
 
`added` TIMESTAMP NOT NULL ,
 
`source` VARCHAR( 255 ) NOT NULL ,
 
`source` VARCHAR( 255 ) NOT NULL ,
Line 33: Line 38:
 
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
 
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
 
`content` VARCHAR( 160 ) NOT NULL ,
 
`content` VARCHAR( 160 ) NOT NULL ,
`post_date` DATE NOT NULL ,
+
`post_date` datetime NOT NULL ,
 
`added` TIMESTAMP NOT NULL ,
 
`added` TIMESTAMP NOT NULL ,
 
`source` VARCHAR( 255 ) NOT NULL ,
 
`source` VARCHAR( 255 ) NOT NULL ,

Revision as of 21:45, 25 April 2012

Conditional Auto Tweeter written in PHP

  • Using OAuth Library by Matt Harris: https://github.com/themattharris/tmhOAuth
  • Running via CLI PHP
  • Design an application to use Matt Harris' library as a function to auto tweet events based on existing conditions

Current Functionality

  • Using MidsouthMakersDev Twitter account
  • Able to be run from the command line to post static tweets.
  • Able to be run from a url to post static tweets.
  • Checks pending table and checks if their post date < current time

To Be Done

  • Need to handle adding to pending table
  • Need to handle adding to history
  • Need to handle Remove from pending
  • Cron local system to test for pending tweets

Goals

  • Take input from multiple sources
  • Reliably validate source of all incoming data
  • Use access list or secret hash to prevent abuse

Database Schema

  • Pending Table
CREATE TABLE  `mmtweeter`.`pending` (
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
`content` VARCHAR( 160 ) NOT NULL ,
`post_date` datetime NOT NULL ,
`added` TIMESTAMP NOT NULL ,
`source` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY (  `id` )
) ENGINE = MYISAM ;
  • History Table
CREATE TABLE  `mmtweeter`.`history` (
`id` INT( 6 ) NOT NULL AUTO_INCREMENT ,
`content` VARCHAR( 160 ) NOT NULL ,
`post_date` datetime NOT NULL ,
`added` TIMESTAMP NOT NULL ,
`source` VARCHAR( 255 ) NOT NULL ,
`response_code` INT( 4 ) NOT NULL ,
PRIMARY KEY (  `id` )
) ENGINE = MYISAM
  • Secrets Table
CREATE TABLE  `mmtweeter`.`secrets` (
`id` INT NOT NULL AUTO_INCREMENT ,
`source` VARCHAR( 255 ) NOT NULL ,
`secret` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY (  `id` )
) ENGINE = MYISAM ;