Advertisement
irokemr

MOSTRAR ID canal de youtube php

May 5th, 2018
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. 1.-) ABRE BLOC DE NOTAS.
  2. 2.-) COPIA Y PEGA EL CODIGO PHP.
  3. 3.-) ARCHIVO -> GUARDAR COMO -> Y LO GUARDAS POR EJEMPLO "IDvideo.php".
  4. 4.-)SUBELO A TÚ SITIO WEB DÓNDE PERMITA CODIGOS PHP.
  5. 5.-) CUÁNDO LO TENGAS SUBIDO SÓLO DEBES PONER: TUWEB.COM/IDvideo.php?usuario=NOMBRE DEL CANAL DE YOUTUBE
  6. 6.-) EJEMPLO: -> TUWEB.COM/IDvideo.php?usuario=irokehabbo
  7.  
  8. EL CODIGO SOLO MOSTRARA EL ID DEL CANAL
  9.  
  10.  
  11. <?php
  12. error_reporting(0);
  13.  
  14.  
  15. echo"<meta charset='utf-8'>";
  16.  
  17. $usuario = $_GET['usuario'];
  18. $page= file_get_contents("https://youtube.com/user/$usuario/about");
  19.  
  20. $canalID = explode ('https://www.youtube.com/feeds/videos.xml?channel_id=', $page);
  21. $canalID = explode ('"', $canalID[1]);
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. echo $canalID[0];
  31.  
  32.  
  33.  
  34.  
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement