User Tools

Site Tools


filters-list

Aggregates list

$url = "http://api.itcg.eredan.com/json.php/aggregates?apiKey=wnQu6Utm90R8Ho50bX95HpjszQMC6853"; $res = file_get_contents($url); $ares = json_decode($res,true); foreach($ares['data'] as $v){ $filters[] = $v; }   foreach($filters as $filter){ $url = "http://api.itcg.eredan.com/json.php/".$filter."?apiKey=wnQu6Utm90R8Ho50bX95HpjszQMC6853&locale=en"; $res = file_get_contents($url); $ares= json_decode($res,1);   echo "<html>"; echo "<h3>".ucfirst($filter)."</h3>"; echo "<table><tr><th>ID</th><th>Name</th"; if(in_array($filter,array('guilds','classes','races','rarities'))) echo "><th>Visual</th>"; echo "</tr>"; $list = array(); foreach($ares['data'] as $v){ $list[$v['id']] = $v; } ksort($list); foreach($list as $v){ echo "<tr><td>".$v['id']."</td><td>".$v['name']."</td>"; if(!empty($v['visuals'])) echo "<td><img src='".$ares['visual_url_prefix']."/".$v['visuals']['medium']."'></td>"; echo "</tr>"; } echo "</table>"; echo "</html>"; }

filters-list.txt · Last modified: 2012/12/18 13:21 by admin