Last active
August 29, 2015 14:10
-
-
Save scumola/56754ce473f3f4521ed2 to your computer and use it in GitHub Desktop.
perk points grabber - replace ACCESS_TOKEN AND USERID with your info
This file contains 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
#!/usr/bin/php | |
<?php | |
$access_token = 'ACCESS_TOKEN'; | |
$url = "https://api.perk.com/api/usercurrencyinformation?user_id=USERID&access_token=$access_token&device_type=web_browser"; | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
$data = json_decode($data); | |
$points = $data->userperks->availableperks; | |
$tokens = $data->userperks->availabletokens; | |
print "points:$points tokens:$tokens\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment