Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/05/2015, 02:51
Avatar de NueveReinas
NueveReinas
 
Fecha de Ingreso: septiembre-2013
Ubicación: No tan Buenos Aires
Mensajes: 1.101
Antigüedad: 11 años, 2 meses
Puntos: 145
Respuesta: Cualquiera lo sabe menos yo.

Mira el comentario de "Daniel Mitchell".

http://blog.michaelhelmick.com/2012/...re-by-user-id/

Cita:
Daniel Mitchell
Hello, I have found this methodolgy does not always work. Also, because it is not contained in Google documentation, it is not guaranteed to always be available. I have discovered an alternate way of display the profile picture of a given username using a little piece of javascript to get and then display the picture from the youtube feed api.

Basically you can make a call to this url: http://gdata.youtube.com/feeds/api/u...ubeProfileInfo replacing the [username] with the user you want. This url returns the results as a json wrapped in a .js file which will call the javascript function provided in the paramter ‘callback’. e.g. function showYouTubeProfileInfo(data)
{
document.getElementById(‘userprofile’).innerHTML = ” “;
}

This then enables you to process the returned data and display it.

I have got sample code here http://daniel-mitchell.com/blog/disp...e-by-username/ which you can use.

-----------------------------------

Hello. Sorry it seems some of the javascript in my above comment has been stripped out. The innerHTML should contain a image tag with the src set to: data.entry.media$thumbnail.url

Hope that helps.
Por ejemplo:

Código HTML:
Ver original
  1. <!doctype html>
  2. <meta charset="utf-8">
  3. <title>Test</title>
  4. <script type="text/javascript">
  5. function showYouTubeProfileInfo(data)
  6. {
  7.     var url = data.entry.media$thumbnail.url;
  8.     document.getElementById('userprofile').innerHTML = "<img src='" + url + "'/>";
  9. };
  10. </head>
  11.  
  12. <div id="userprofile"></div>
  13. <script type="text/javascript" src="http://gdata.youtube.com/feeds/api/users/elrubiusomg?fields=media:thumbnail&alt=json-in-script&format=5&callback=showYouTubeProfileInfo"></script>
  14. </body>
  15. </html>
__________________
¿Te sirvió la respuesta? Deja un +1

Última edición por NueveReinas; 11/05/2015 a las 03:35