Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getWeather($key = "Napier", $l = "/q/zmw:00000.1.93373") {
- $cache = SS_Cache::factory("WeatherInfo");
- if (!($result = $cache->load($key))) {
- $result = file_get_contents("http://api.wunderground.com/api/4b7e97b6412b0274/forecast/" . $l . ".json");
- $cache->save($result, $key); //this is where docs are confusing, they say $cache->save($result) but how does SS_Cache know what key to save under????
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement