Quantcast
WoWInterface: SVN - UrbanAchiever - Diff - Rev 162 and 158 - /trunk/script-import.php

WoWInterface SVN UrbanAchiever

[/] [trunk/] [script-import.php] - Diff between revs 158 and 162

Show entire file | Details | Blame | View Log

Rev 158 Rev 162
Line 1... Line 1...
<?php
<?php
ini_set('allow_url_fopen'1);
ini_set('allow_url_fopen'1);
$URLs = array(
$URLs = array(
    "http://legion.wowhead.com/achievements/side:-1"=> 1,
    "https://www.wowhead.com/achievements/side:-1"=> 1,
    "http://legion.wowhead.com/achievements/side:-2"=> 2
    "https://www.wowhead.com/achievements/side:-2"=> 2
    /*"http://www.wowhead.com/achievements?filter=si=-1;cr=9;crs=2;crv=4000" => 1,
    /*"http://www.wowhead.com/achievements?filter=si=-1;cr=9;crs=2;crv=4000" => 1,
    "http://www.wowhead.com/achievements?filter=si=-1;cr=9;crs=5;crv=4000" => 1,
    "http://www.wowhead.com/achievements?filter=si=-1;cr=9;crs=5;crv=4000" => 1,
    "http://www.wowhead.com/achievements?filter=si=-2;cr=9;crs=2;crv=4000" => 2,
    "http://www.wowhead.com/achievements?filter=si=-2;cr=9;crs=2;crv=4000" => 2,
    "http://www.wowhead.com/achievements?filter=si=-2;cr=9;crs=5;crv=4000" => 2*/
    "http://www.wowhead.com/achievements?filter=si=-2;cr=9;crs=5;crv=4000" => 2*/
);
);
Line 15... Line 15...
    exec($cmd);
    exec($cmd);
    $page file_get_contents($outputfile);
    $page file_get_contents($outputfile);
    $page str_replace(array("\r\n""\n""\r"), ''$page);
    $page str_replace(array("\r\n""\n""\r"), ''$page);
    $startString '<div id="lv-achievements" class="listview"></div><script type="text/javascript">WH.Gatherer.addData(10, 1, ';
    $pos strpos($page'<div id="lv-achievements" class="listview">');
    $endString ');WH.Gatherer.addData';
 
        
 
    $pos strpos($page$startString);
    $wokingstring substr($page$pos);
    $wokingstring substr($page$pos);
    $wokingstring str_replace('<div id="lv-achievements" class="listview"></div><script type="text/javascript">//<![CDATA[var _ = {};'''$wokingstring);
    $wokingstring str_replace($startString''$wokingstring);
    $pos strpos($wokingstring'_ = g_achievements;');
    $pos strpos($wokingstring$endString);
    $wokingstring substr($wokingstring0$pos);
    $wokingstring substr($wokingstring0$pos);
    $wokingstring str_replace(';$.extend(true, g_achievements, _);'""$wokingstring);
    $wokingstring str_replace($endString""$wokingstring);
 
    $workingarray explode(';'$wokingstring);
 
 
    $json json_decode($wokingstringtrue);
    foreach($workingarray as $achievement){
    foreach($json as $id => $achievement){
        $pos strpos($achievement'","icon":"');
        $completearray[$id] = $side ',&nbsp;&nbsp;&nbsp;--' str_replace('\\','',$achievement['name_enus']);
        $achievement substr($achievement0$pos);
 
        $achievement str_replace(array('_['']={"name_enus":"'), array('''*-*'), $achievement);
 
        $achievement explode('*-*'$achievement);
 
        $completearray[$achievement[0]] = $side ',&nbsp;&nbsp;&nbsp;--' str_replace('\\','',$achievement[1]);
 
    }
    }
}
}
foreach($completearray as $k => $v){
foreach($completearray as $k => $v){