Beispiel #1
0
 public static function homeTimeline($count = 100, $maxid = null)
 {
     $key = self::$TMPKEY . 'homeTimeline-' . $maxid;
     if (!\deco\extensions\cache\Cache::isOlderThan($key, self::CACHE_TIME)) {
         return \deco\extensions\cache\Cache::get($key);
     }
     $url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
     $getfield = "?&count={$count}";
     $getfield .= is_null($maxid) ? '' : "&max_id={$maxid}";
     $data = self::fetch($url, $getfield);
     \deco\extensions\cache\Cache::set($key, $data);
     return $data;
 }
Beispiel #2
0
 public static function getMediaByUser($user, $count = 20, $maxid = null)
 {
     $key = self::$TMPKEY . 'mediaByUser-' . $user . '-' . $maxid;
     if (!\deco\extensions\cache\Cache::isOlderThan($key, self::CACHE_TIME)) {
         return \deco\extensions\cache\Cache::get($key);
     }
     $url = "https://api.instagram.com/v1/users/{$user}/media/recent/?access_token=" . self::$accessToken;
     $url .= "&count={$count}";
     $url .= is_null($maxid) ? '' : "&max_id={$maxid}";
     $data = self::executeGet($url);
     \deco\extensions\cache\Cache::set($key, $data);
     return $data;
 }