Advertisement
comniemeer

RPG CP Drogendealer Skill

Mar 14th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. <?php
  2. $cookiefile = "cookies.txt";
  3.  
  4. $parseUrl = "http://cp.rpg-city.de/";
  5.  
  6. $parse = curl_init();
  7.  
  8. curl_setopt($parse, CURLOPT_URL, $parseUrl);
  9. //curl_setopt($parse, CURLOPT_FOLLOWLOCATION, 1);
  10. curl_setopt($parse, CURLOPT_HEADER, 1);
  11. curl_setopt($parse, CURLOPT_RETURNTRANSFER, 1);
  12. curl_setopt($parse, CURLOPT_COOKIEJAR, $cookiefile);
  13. curl_setopt($parse, CURLOPT_COOKIEFILE, $cookiefile);
  14. curl_setopt($parse, CURLOPT_SSL_VERIFYPEER, false);
  15. curl_setopt($parse, CURLOPT_SSL_VERIFYHOST, false);
  16.  
  17. $parseResponse = curl_exec($parse);
  18.  
  19. curl_close($parse);
  20.  
  21. $dom = new DOMDocument();
  22.  
  23. libxml_use_internal_errors(true);
  24.  
  25. $dom->loadHTML($parseResponse);
  26.  
  27. $content = $dom->getElementById("contentPageContent");
  28.  
  29. if (!is_null($content)) {
  30.     $tables = $content->childNodes;
  31.    
  32.     echo $content->nodeValue . "<br>";
  33.    
  34.     $skillsTable = $tables->item(8)->childNodes;
  35.    
  36.     echo $tables->item(8)->nodeValue . "<br>";
  37.    
  38.     $skills = $skillsTable->item(1)->childNodes;
  39.    
  40.     echo $skillsTable->item(1)->nodeValue . "<br>";
  41.    
  42.     $skillRow = $skills->item(0)->childNodes;
  43.     $skill = split(" ", str_replace("(", "", $skillRow->item(2)->nodeValue));
  44.    
  45.     echo "Skill: " . $skill[0];
  46.     echo "<br>";
  47.     echo "Exp: " . $skill[1];
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement