-
Notifications
You must be signed in to change notification settings - Fork 0
/
getHero.php
38 lines (34 loc) · 1.1 KB
/
getHero.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
function stripTojSon($json,$time){
$jsonVar = "jsonp".$time."(";
$json = str_replace($jsonVar,"",$json);
$json = str_replace("})","}",$json);
return json_decode($json,true);
}
function getHeroes($key,$city){
getHero:
$time = time();
$var = @file_get_contents("http://159.203.92.38/server1/game/gen_conscribe_api.php?jsonpcallback=jsonp".$time."&_=".($time+1485495)."&key=".$key."&city=".$city."&action=gen_list&_l=en&_p=EW-DROID-KR-");
if (!(strpos($var,'})') !== false)) {
goto getHero;
}
$hero = stripTojSon($var,$time);
echo json_encode($hero);
}
function getAllCity($key){
start:
$time = time();
$var = @file_get_contents("http://159.203.92.38/server1/game/get_userinfo_api.php?jsonpcallback=jsonp".$time."&_=".($time+1485495)."&key=".$key."&_l=en&_p=EW-DROID-KR-");
if (!(strpos($var,'})') !== false)) {
goto start;
}
$city = stripTojSon($var,$time);
if(count(@$city['ret']['user']['city'])>0){
//for($ctr=0;$ctr<count($city['ret']['user']['city']);$ctr++){
getHeroes($key,$city['ret']['user']['city'][0]['id']);
//}
}
}
getAllCity($_REQUEST['key']);
//echo json_encode($list);
?>