Advertisement
Guest User

Untitled

a guest
Apr 18th, 2013
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function getWeather($key = "Napier", $l = "/q/zmw:00000.1.93373") {
  2. $cache = SS_Cache::factory("WeatherInfo");
  3. if (!($result = $cache->load($key))) {
  4. $result = file_get_contents("http://api.wunderground.com/api/4b7e97b6412b0274/forecast/" . $l . ".json");
  5. $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????
  6. }
  7. return $result;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement