Advertisement
Guest User

PHP Source Code

a guest
Jan 7th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2. require 'openid.php';
  3. try {
  4. $openid = new LightOpenID('workinganonymouswebsite.com');
  5. if(!$openid->mode) {
  6. $openid->identity = 'http://steamcommunity.com/openid';
  7. header('Location: ' . $openid->authUrl());
  8. ?>
  9. <?php
  10. } elseif($openid->mode == 'cancel') {
  11. echo 'User has canceled authentication!';
  12. } else {
  13. $steamurl = ($openid->validate() ? $openid->identity . '' : 'error');
  14. if ($steamurl == 'error') {
  15. print "There was an error signing in.";
  16. }
  17. else {
  18. $id = end(explode('/', $steamurl));
  19. $jsonurl = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=XXXXXXXXXXXXXXXXXX&steamids=" . $id . "&format=json";
  20. $json = file_get_contents($jsonurl,0,null,null);
  21. $json_output = json_decode($json);
  22. echo $json_output['players']['personaname'];
  23. }
  24. }
  25. } catch(ErrorException $e) {
  26. echo $e->getMessage();
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement