Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('simple_html_dom.php');
- function scrapeHighscore($world) {
- $html = str_get_html('https://secure.tibia.com/community/?subtopic=highscores&world=' . $world);
- $tables = $html->find('table');
- foreach($tables as $table) {
- $names = $table->find('a');
- foreach($names as $name) {
- return $name . ' - ';
- }
- $levels = $table->find('td[@width="15%"]');
- foreach ($levels as $level) {
- return $level . ' - ';
- }
- $experiences = $table->find('td[@width="20%"]');
- foreach ($experiences as $experience) {
- return $experience . '<br>';
- }
- }
- }
- echo scrapeHighscore('Antica');
- ?>
- Meendel 536 2538560931
- Drendaric 514 2237710308
- Magicalse 509 2180132453
- ...
- King Migoon 446 1460356304
- function scrapeHighscore($world) {
- $output = '';
- $html = str_get_html('https://secure.tibia.com/community /?subtopic=highscores&world=' . $world);
- $tables = $html->find('table');
- foreach($tables as $table) {
- $names = $table->find('a');
- foreach($names as $name) {
- $output.= $name . ' - ';
- }
- $levels = $table->find('td[@width="15%"]');
- foreach ($levels as $level) {
- $output.= $level . ' - ';
- }
- $experiences = $table->find('td[@width="20%"]');
- foreach ($experiences as $experience) {
- $output.= $experience . '<br>;
- }
- }
- return $output;
- }
- echo scrapeHighscore('Antica');
- $html = str_get_html('https://secure.tibia.com/community /?subtopic=highscores&world=' . $world);
- echo $html;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement