Last active
December 17, 2015 10:19
-
-
Save ebinnion/5593813 to your computer and use it in GitHub Desktop.
Followerwonk Social Authority API Code Example
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 | |
// Not currently working. | |
// Example Output | |
/* | |
https://api.followerwonk.com/social-authority?screen_name=randfish;AccessID=member-NTFhMjQxOTQtYTcwNi01YzI4LTk0OTYtZDZlY mRlYzJiMjVk;Timestamp=1368728186;Signature=S97mqDTS0qngjKR41hPhdO4BHpE%3D | |
"401 Unauthorized" | |
*/ | |
$uri = 'https://api.followerwonk.com/social-authority'; | |
$accessID = 'member-NTFhMjQxOTQtYTcwNi01YzI4LTk0OTYtZDZlYmRlYzJiMjVk'; | |
$secretKey = 'fpndlhefzzsugpfcxvadtkdoqwaiwyly'; | |
$time = time() + 500; | |
$signature = urlencode(base64_encode(hash_hmac("sha1", "{$accessID}\n{$secretKey}", $secretKey, true))); | |
$auth = "AccessID={$accessID};Timestamp={$time};Signature={$signature}"; | |
echo "{$uri}?screen_name=randfish;{$auth}<br><br>"; | |
$response = json_encode(file_get_contents("{$uri}?screen_name=randfish;{$auth}")); | |
print_r($response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment