Difference between revisions of "MM-Tweeter"
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
* Reliably validate source of all incoming data | * Reliably validate source of all incoming data | ||
* Use access list or secret hash to prevent abuse | * Use access list or secret hash to prevent abuse | ||
+ | |||
+ | ==Database Schema== | ||
+ | * Pending Table | ||
+ | <pre> | ||
+ | CREATE TABLE `mmtweeter`.`pending` ( | ||
+ | `id` INT( 6 ) NOT NULL AUTO_INCREMENT , | ||
+ | `content` VARCHAR( 160 ) NOT NULL , | ||
+ | `post_date` DATE NOT NULL , | ||
+ | `added` TIMESTAMP NOT NULL , | ||
+ | `source` VARCHAR( 255 ) NOT NULL , | ||
+ | PRIMARY KEY ( `id` ) | ||
+ | ) ENGINE = MYISAM ; | ||
+ | </pre> | ||
+ | * History Table | ||
+ | <pre> | ||
+ | CREATE TABLE `mmtweeter`.`history` ( | ||
+ | `id` INT( 6 ) NOT NULL AUTO_INCREMENT , | ||
+ | `content` VARCHAR( 160 ) NOT NULL , | ||
+ | `post_date` DATE NOT NULL , | ||
+ | `added` TIMESTAMP NOT NULL , | ||
+ | `source` VARCHAR( 255 ) NOT NULL , | ||
+ | `response_code` INT( 4 ) NOT NULL , | ||
+ | PRIMARY KEY ( `id` ) | ||
+ | ) ENGINE = MYISAM | ||
+ | </pre> | ||
+ | * Secrets Table | ||
+ | <pre> | ||
+ | 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 ; | ||
+ | </pre> |
Revision as of 18:16, 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.
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` DATE 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` DATE 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 ;