Exemplo n.º 1
0
 /**
  * Loads the news for the given game with the given restrictions
  *
  * @param int $appId The unique Steam Application ID of the game (e.g. 440
  *        for Team Fortress 2). See
  *        http://developer.valvesoftware.com/wiki/Steam_Application_IDs for
  *        all application IDs
  * @param int $count The maximum number of news to load (default: 5).
  *        There's no reliable way to load all news. Use really a really
  *        great number instead
  * @param int $maxLength The maximum content length of the news (default:
  *        null). If a maximum length is defined, the content of the news
  *        will only be at most <var>maxLength</var> characters long plus an
  *        ellipsis
  * @return array An array of news items for the specified game with the
  *         given options
  */
 public static function getNewsForApp($appId, $count = 5, $maxLength = null)
 {
     $params = ['appid' => $appId, 'count' => $count, 'maxlength' => $maxLength];
     $data = WebApi::getJSONObject('ISteamNews', 'GetNewsForApp', 2, $params);
     $newsItems = [];
     foreach ($data->appnews->newsitems as $newsData) {
         $newsItems[] = new AppNews($appId, $newsData);
     }
     return $newsItems;
 }
 protected function fetchLanguage($language)
 {
     $params = ['appid' => $this->appId, 'l' => $language];
     $data = WebApi::getJSONObject('ISteamUserStats', 'GetSchemaForGame', 2, $params);
     return $data->game;
 }