Advertisement
Guest User

Untitled

a guest
Aug 28th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. class Steam_Rep_Rep {
  3.  
  4. // cURL Variable
  5. private $ch = null;
  6.  
  7. public function __construct() {
  8. // Setup cURL
  9. $this->ch = curl_init();
  10. curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($this->ch, CURLOPT_TIMEOUT, 4);
  12. }
  13.  
  14. public function getUserInfo($steamrep_id) {
  15. // cURL
  16. curl_setopt($this->ch, CURLOPT_URL, "http://steamrep.com/api/beta/reputation/{steam_auth_id}?json=1");
  17. $result = curl_exec($this->ch);
  18. $xml = json_decode($result);
  19. if(!empty($xml->steamrep->reputation)) {
  20. return array(
  21. 'rep' => $xml->steamrep->reputation,
  22. );
  23. } else {
  24. return array(
  25. 'rep' => "No reputation found",
  26. );
  27. }
  28. }
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement