Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $json = json_decode(file_get_contents("http://util.xat.com/wiki/api.php?action=query&titles=Template:List_of_ticket_volunteers&prop=revisions&rvprop=content&format=json"), true);
- $wiki = $json['query']['pages'][18011]['revisions'][0]['*'];
- $wiki = array_filter(explode("\n", explode("|}", explode("</noinclude>", str_replace("", "", preg_replace("/<!--(.*?)-->/", "", $wiki)))[1])[0]));
- $vols = array();
- foreach($wiki as $vol) {
- $vol = explode(" | ", explode("}}", explode("{{", $vol)[1])[0]);
- unset($vol[0]);
- $vol2 = array();
- foreach($vol as $v) {
- $v = explode("=", $v);
- $vol2[$v[0]] = $v[1];
- }
- /*$name = $vol2['name'];
- unset($vol2['name']);
- $vols[$name] = $vol2;*/
- $vols[$vol2['xat']] = $vol2['id'];
- }
- print_r($vols);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement