Move data files to data directory, ignore daemon scripts
This commit is contained in:
6
wunderground.php
Normal file → Executable file
6
wunderground.php
Normal file → Executable file
@@ -2,7 +2,7 @@
|
||||
define('KEY', '2556854ea765c351');
|
||||
define('LIMIT_MINUTE', 10);
|
||||
define('LIMIT_DAY', 500);
|
||||
define('LIMIT_FILE', 'wunderground.json');
|
||||
define('LIMIT_FILE', 'data/wunderground.json');
|
||||
|
||||
function wunderground($sService, $sQuery, $bDebug = false) {
|
||||
/* Get current date values */
|
||||
@@ -59,9 +59,9 @@ function wunderground($sService, $sQuery, $bDebug = false) {
|
||||
'minute' => array($iMinute, $aCount['minute']),
|
||||
'day' => array($iDay, $aCount['day']));
|
||||
file_put_contents(LIMIT_FILE, json_encode($aJSON));
|
||||
|
||||
|
||||
/* Perform actual call */
|
||||
$sUrl = sprintf('http://api.wunderground.com/api/%s/%s/q/%s.json', KEY, $sService, $sQuery);
|
||||
$sJSON = file_get_contents($sUrl);
|
||||
return json_decode($sJSON, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user