Advertisement
irokemr

api twitch php

Nov 19th, 2019
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3.  
  4. $context = stream_context_create($opts);
  5.  
  6.  
  7. $usuario = $_POST['usuario'];
  8. $file = file_get_contents("https://todocodigos.000webhostapp.com/twitch/infotwitch.php?usuario=$usuario", false, $context);
  9.  
  10.  
  11.  
  12. $image_data = json_decode($file, true);
  13. $twitch = json_decode($file, true);
  14.  
  15.  
  16. $news = json_decode($news, true);
  17. ?>  <?php  for ($i = 0; $i < count($image_data['info_twitch']); $i ++) {
  18.    
  19.  
  20.  
  21.                ?>
  22.                
  23.                
  24.              
  25.            
  26.  
  27.            
  28.  <b>Espectadores:</b> => <?php echo $twitch['info_twitch'][$i]['Espectadores'];  ?>
  29.  
  30.  <br>
  31.  <b>Estado del streamer:</b> => <?php echo $twitch['info_twitch'][$i]['Estado']  ?>
  32.   <br>
  33.  <b>Categoria</b> => <?php echo $twitch['info_twitch'][$i]['categoria']?>
  34.  
  35.    <br>
  36.  <b>Idioma del streamer</b> => <?php echo $twitch['info_twitch'][$i]['Idioma_del_streamer']?>
  37.  <br>
  38.  <b>Visualizaciones:</b> => <?php echo $twitch['info_twitch'][$i]['Visualizaciones_totales']?>
  39.   <br>
  40.  <b>Seguidores del canal:</b> =><?php echo $twitch['info_twitch'][$i]['Seguidores_del_canal']?>
  41.    <br>
  42.  <b>Logo del canal:</b> => <?php echo $twitch['info_twitch'][$i]['Logo_del_canal']?>
  43.    <br>
  44.     <b>Banner del video:</b> => <?php echo $twitch['info_twitch'][$i]['Banner_del_video']?>
  45.     <br>
  46.      <b>Banner del perfil:</b> => <?php echo $twitch['info_twitch'][$i]['Banner_del_perfil']?>
  47.    <br>
  48.  <b>Ultimo titulo:</b> => <?php echo $twitch['info_twitch'][$i]['Titulo_del_último_vídeo']?>
  49.  <br>
  50.  ******************************
  51.  <br>
  52.  <form action="" method="POST">
  53.  <input type="text" size="50" name="usuario" id="usuario" placeholder="Escribe el nombre del streamer">
  54.  
  55.  <input type="submit" value="Ver info">
  56.   </form>
  57.    *****************************
  58.  <br>
  59.  
  60.  
  61. <?php }?>
  62. <h3>API TWITCH:
  63. <br>
  64. <a href="https://pastebin.com/kn0HAAhu" target="_blank">api twitch</a>
  65. </h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement