runescape-highscore-lookup
Gesponsorde koppelingen
PHP script bestanden
Code (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
$rsname = $_GET['rsname'];
$a = $_GET['a'];
$b = $_GET['b'];
$c = $_GET['c'];
$d = $_GET['d'];
$e = $_GET['e'];
if (empty($rsname)) {
echo "Geen gebruikersnaam ingevoerd";
}
else {
$url = "http://hiscore.runescape.com/index_lite.ws?player=".$rsname;
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$score = curl_exec($ch);
curl_close($ch);
$uitslag = preg_split("`(\n|,)`", $score);
if ($uitslag[0] == 0) { echo "Gebruikersnaam <b>" . $rsname . "</b> staat niet in de RuneScape highscores."; }
else {
$skills = array(
'Overall',
'Attack',
'Defence',
'Strenght',
'Hitpoints',
'Range',
'Prayer',
'Magic',
'Cooking',
'Woodcutting',
'Fletching',
'Fishing',
'Firemaking',
'Crafting',
'Smithing',
'Mining',
'Herblore',
'Agility',
'Thieving',
'Slayer',
'Farming',
'Runecrafting',
'Hunter',
'Construction',
'Summoning'
);
echo "RuneScape Hiscores van <b>" . $rsname . "</b>.";
echo "\n<br /><br />\n";
echo "<table width=\"700\" border=\"0\">\n";
if ($a == 0) {
echo "<tr>";
if ($b == 0) { echo "<td><b>Skill</b></td>\n"; }
if ($c == 0) { echo "<td><b>Rank</b></td>\n"; }
if ($d == 0) { echo "<td><b>Level</b></td>\n"; }
if ($e == 0) { echo "<td><b>Exp</b></td>\n"; }
echo "</tr>";
}
$i = 0;
$ii = 0;
$iii = 1;
$iiii = 2;
while ($i <= 24):
$uitslag[$ii] = number_format($uitslag[$ii], 0, ',', ',');
$uitslag[$iiii] = number_format($uitslag[$iiii], 0, ',', ',');
if ($uitslag[$ii] == -1) { $uitslag[$ii] = " "; }
if ($uitslag[$iii] == -1) { $uitslag[$iii] = " "; }
if ($uitslag[$iiii] == -1) { $uitslag[$iiii] = "<i>Niet gevonden</i>\n"; }
echo "<tr>";
if ($b ==0) { echo "<td><b>" . $skills[$i] . "</b></td>\n"; }
if ($c ==0) { echo "<td>" . $uitslag[$ii] . "</td>\n"; }
if ($d ==0) { echo "<td>" . $uitslag[$iii] . "</td>\n"; }
if ($e ==0) { echo "<td>" . $uitslag[$iiii] . "</td>\n"; }
echo "</tr>";
$i++;
$ii = $ii + 3;
$iii = $iii + 3;
$iiii = $iiii + 3;
endwhile;
echo "\n</table>";
} }
?>
$rsname = $_GET['rsname'];
$a = $_GET['a'];
$b = $_GET['b'];
$c = $_GET['c'];
$d = $_GET['d'];
$e = $_GET['e'];
if (empty($rsname)) {
echo "Geen gebruikersnaam ingevoerd";
}
else {
$url = "http://hiscore.runescape.com/index_lite.ws?player=".$rsname;
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$score = curl_exec($ch);
curl_close($ch);
$uitslag = preg_split("`(\n|,)`", $score);
if ($uitslag[0] == 0) { echo "Gebruikersnaam <b>" . $rsname . "</b> staat niet in de RuneScape highscores."; }
else {
$skills = array(
'Overall',
'Attack',
'Defence',
'Strenght',
'Hitpoints',
'Range',
'Prayer',
'Magic',
'Cooking',
'Woodcutting',
'Fletching',
'Fishing',
'Firemaking',
'Crafting',
'Smithing',
'Mining',
'Herblore',
'Agility',
'Thieving',
'Slayer',
'Farming',
'Runecrafting',
'Hunter',
'Construction',
'Summoning'
);
echo "RuneScape Hiscores van <b>" . $rsname . "</b>.";
echo "\n<br /><br />\n";
echo "<table width=\"700\" border=\"0\">\n";
if ($a == 0) {
echo "<tr>";
if ($b == 0) { echo "<td><b>Skill</b></td>\n"; }
if ($c == 0) { echo "<td><b>Rank</b></td>\n"; }
if ($d == 0) { echo "<td><b>Level</b></td>\n"; }
if ($e == 0) { echo "<td><b>Exp</b></td>\n"; }
echo "</tr>";
}
$i = 0;
$ii = 0;
$iii = 1;
$iiii = 2;
while ($i <= 24):
$uitslag[$ii] = number_format($uitslag[$ii], 0, ',', ',');
$uitslag[$iiii] = number_format($uitslag[$iiii], 0, ',', ',');
if ($uitslag[$ii] == -1) { $uitslag[$ii] = " "; }
if ($uitslag[$iii] == -1) { $uitslag[$iii] = " "; }
if ($uitslag[$iiii] == -1) { $uitslag[$iiii] = "<i>Niet gevonden</i>\n"; }
echo "<tr>";
if ($b ==0) { echo "<td><b>" . $skills[$i] . "</b></td>\n"; }
if ($c ==0) { echo "<td>" . $uitslag[$ii] . "</td>\n"; }
if ($d ==0) { echo "<td>" . $uitslag[$iii] . "</td>\n"; }
if ($e ==0) { echo "<td>" . $uitslag[$iiii] . "</td>\n"; }
echo "</tr>";
$i++;
$ii = $ii + 3;
$iii = $iii + 3;
$iiii = $iiii + 3;
endwhile;
echo "\n</table>";
} }
?>