Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'openid.php';
- try {
- $openid = new LightOpenID('workinganonymouswebsite.com');
- if(!$openid->mode) {
- $openid->identity = 'http://steamcommunity.com/openid';
- header('Location: ' . $openid->authUrl());
- ?>
- <?php
- } elseif($openid->mode == 'cancel') {
- echo 'User has canceled authentication!';
- } else {
- $steamurl = ($openid->validate() ? $openid->identity . '' : 'error');
- if ($steamurl == 'error') {
- print "There was an error signing in.";
- }
- else {
- $id = end(explode('/', $steamurl));
- $jsonurl = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=XXXXXXXXXXXXXXXXXX&steamids=" . $id . "&format=json";
- $json = file_get_contents($jsonurl,0,null,null);
- $json_output = json_decode($json);
- echo $json_output['players']['personaname'];
- }
- }
- } catch(ErrorException $e) {
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement