gfritz/HackVT — pull request #2 by EJEHardenberg (2012-10-20 03:46:00+00:00)
Title: aggregation pull request

install mysql on your computer or have a WORKING connection to your db.

make a database and have a table with the following structure:

CREATE TABLE IF NOT EXISTS `weather` (
`id` int(255) NOT NULL AUTO_INCREMENT COMMENT 'for pk',
`date` date NOT NULL,
`maxHum` float NOT NULL COMMENT 'max humidity',
`minHum` float NOT NULL COMMENT 'min humidity',
`rain` int(3) NOT NULL DEFAULT '0' COMMENT 'bool for rain',
`snow` int(3) NOT NULL DEFAULT '0' COMMENT 'bool for snow',
`hail` int(3) NOT NULL DEFAULT '0' COMMENT 'bool for hail',
`precip` float NOT NULL COMMENT 'inches of rain',
`maxTemp` float NOT NULL COMMENT 'max temperature',
`minTemp` float NOT NULL COMMENT 'min temperature',
`avgTemp` float NOT NULL COMMENT 'mean temperature',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

and then make a hackConf.php file two directorys above the mySQLDB.php file and put in your database info.

go to the weather api and request a key, replace the key in your copy of the weatherAPI.php file variable and then run. it may be a good idea to test your conncetion to your database from php first though since we only get a limited number of api requests.