xnite

Get Klout Score - Reduced to 6 Lines Lines

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