Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Steam_Rep_Rep {
- // cURL Variable
- private $ch = null;
- public function __construct() {
- // Setup cURL
- $this->ch = curl_init();
- curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($this->ch, CURLOPT_TIMEOUT, 4);
- }
- public function getUserInfo($steamrep_id) {
- // cURL
- curl_setopt($this->ch, CURLOPT_URL, "http://steamrep.com/api/beta/reputation/{steam_auth_id}?json=1");
- $result = curl_exec($this->ch);
- $xml = json_decode($result);
- if(!empty($xml->steamrep->reputation)) {
- return array(
- 'rep' => $xml->steamrep->reputation,
- );
- } else {
- return array(
- 'rep' => "No reputation found",
- );
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement