Last active
March 1, 2022 21:35
-
-
Save oliveiraev/2d40237ea99ef146044d9a5d86efc28e to your computer and use it in GitHub Desktop.
Get Tibia available Worlds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init('https://www.tibia.com/community/?subtopic=killstatistics'); | |
curl_setopt_array($curl, array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => 'utf-8', | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', | |
CURLOPT_POST => true, | |
CURLOPT_POSTFIELDS => array('world' => 'Adra'), | |
)); | |
$response = curl_exec($curl); | |
curl_close($curl); | |
$content = new DOMDocument('1.0', 'utf-8'); | |
$content->loadHTML($response); | |
$table = $content->getElementsByTagName('table')->item(2); | |
var_dump($table->ownerDocument->saveHTML($table)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated original version