Created
September 12, 2010 17:53
-
-
Save JayCuthrell/576286 to your computer and use it in GitHub Desktop.
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 | |
// okay.. get your own key... it's painless and free | |
// | |
$apikey = 'thiswillnotworkuntilyouputinyourownkeysillybaboon'; | |
// | |
// seriously, if you read this far... get your own key ;-) | |
// this is the trust rank example | |
$uri = 'http://api.infochimps.com/soc/net/tw/trstrank.json?'; | |
if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) { | |
?> | |
This API is Bananas B A N A N A S | |
Usage: | |
<?php echo $argv[0]; ?> <option> | |
<option> a Twitter screen name that would like to | |
have Trust Rank returned. With the --help, -help, -h, | |
or -? options, you can get anemic help message. | |
<?php | |
} else { | |
$screen_name = $argv[1]; | |
$query = file_get_contents($uri."apikey=".$apikey."&screen_name=".$screen_name,true); | |
$convert = json_decode($query); | |
echo $convert->screen_name .': '. $convert->trstrank; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment