Pythorian

[PHP] Get Klout Score

Aug 20th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2. $klout_api_key = "";
  3. $screenName = $argv[1];
  4. $klout_id = json_decode(file_get_contents("http://api.klout.com/v2/identity.json/twitter?screenName=$screenName&key=$klout_api_key"))->{'id'};
  5. $score = json_decode(file_get_contents("http://api.klout.com/v2/user.json/$klout_id/score?key=$klout_api_key"))->{'score'};
  6.  
  7. echo "Klout score for $screenName is $score!\n";
  8. ?>
Advertisement
Add Comment
Please, Sign In to add comment