irokemr

info perfil steam php api

Dec 30th, 2020 (edited)
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.51 KB | None | 0 0
  1. <?php
  2.  error_reporting(0);
  3.  
  4.  
  5. $api = "AQUI LA API DE STEAM"; <!-- Puedes obtener la api de steam en la siguiente url: https://steamcommunity.com/dev-->
  6.  
  7.  
  8. $usuario = $_GET["usuario"];
  9. $page= file_get_contents("https://steamcommunity.com/id/$usuario");
  10.  
  11. $steamID64 = explode ('"Profile_', $page);
  12. $steamID64 = explode ('"', $steamID64[1]);
  13.  
  14.  
  15.  
  16. $context = stream_context_create($opts);
  17.  
  18.  
  19.  
  20.  
  21. $file = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$api&steamids=$steamID64[0]", false, $context);
  22.  
  23. $steamID64 = $_GET["steamID64"];
  24. $file1 = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$api&steamids=$steamID64", false, $context);
  25.  
  26. $image_data = json_decode($file, true);
  27. $image_data1 = json_decode($file, true);
  28.  
  29. $estado = json_decode($file, true);
  30. $estado1 = json_decode($file1, true);
  31.  
  32.  $steamID = json_decode($file, true);
  33.  $steamID1 = json_decode($file1, true);
  34.  
  35.  $steamCreado = json_decode($file, true);
  36.  $steamCreado1 = json_decode($file1, true);
  37.  
  38.  $estadoPerfil = json_decode($file, true);
  39.  $estadoPerfil1 = json_decode($file1, true);
  40.  
  41. $estaJugando = json_decode($file, true);
  42. $estaJugando1 = json_decode($file1, true);
  43.  
  44.  
  45.  $nombrereal = json_decode($file, true);
  46. $nombrereal1 = json_decode($file1, true);
  47.  
  48.  $nombre = json_decode($file, true);
  49. $nombre1 = json_decode($file1, true);
  50.  
  51.  
  52.  $avatarfull = json_decode($file, true);
  53. $avatarfull1 = json_decode($file1, true);
  54.  
  55. {
  56.  
  57.  
  58.  
  59.  
  60. }
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. ?>
  68.  
  69.  
  70.  
  71. Estado Steam: <?php
  72. $texto =  $estado['response']['players'][0]['personastate'];
  73. $texto = preg_replace('(0)', '<font color="red">Desconectado</font>', $texto);
  74. $texto = preg_replace('(1)', '<font color="green">Conectado</font>', $texto);
  75. $texto = preg_replace('(3)', '<font color="orange">Ausente</font>', $texto);
  76. echo $texto;
  77.  
  78.  
  79. $texto1 =  $estado1['response']['players'][0]['personastate'];
  80. $texto1 = preg_replace('(0)', '<font color="red">Desconectado</font>', $texto1);
  81. $texto1 = preg_replace('(1)', '<font color="green">Conectado</font>', $texto1);
  82. $texto1 = preg_replace('(3)', '<font color="orange">Ausente</font>', $texto1);
  83. echo $texto1;
  84. echo"<br>";
  85. ?>
  86. Creado en: <?php
  87. echo date('m/d/Y H:i:s', $steamCreado['response']['players'][0]['timecreated']. $steamCreado1['response']['players'][0]['timecreated']);
  88. echo"<br>";
  89.  
  90. ?>
  91.  
  92. Steam ID: <?php echo $steamID['response']['players'][0]['steamid']. $steamID1['response']['players'][0]['steamid']?>
  93. <br>
  94. Estado del perfil: <?php
  95. $texto =  $estadoPerfil['response']['players'][0]['communityvisibilitystate'];  
  96. $texto = preg_replace('(3)', 'Publico', $texto);
  97. $texto = preg_replace('(2)', 'Privado', $texto);
  98. echo $texto;
  99.  
  100. $texto1 =  $estadoPerfil1['response']['players'][0]['communityvisibilitystate'];  
  101. $texto1 = preg_replace('(3)', 'Publico', $texto1);
  102. $texto1 = preg_replace('(2)', 'Privado', $texto1);
  103. echo $texto1;
  104.  
  105.  ?>
  106.  <br>
  107.  Esta Jugando: <?php echo $estaJugando['response']['players'][0]['gameextrainfo']; ?><?php echo $estaJugando1['response']['players'][0]['gameextrainfo']; ?>
  108.  <br>
  109.  Nombre real: <?php echo $nombrereal['response']['players'][0]['realname'];?><?php echo $nombrereal1['response']['players'][0]['realname'];?>
  110.  <br>
  111.  Nombre: <?php echo $nombre['response']['players'][0]['personaname'];?><?php echo $nombre1['response']['players'][0]['personaname'];?>
  112.  
  113.  <br>
  114.  Avatar: <?php echo $avatarfull['response']['players'][0]['avatarfull'];?><?php echo $nombre1['response']['players'][0]['avatarfull'];?>
  115.  
  116.  
Add Comment
Please, Sign In to add comment