Get a users latest youtube videos?

后端 未结 3 1311
星月不相逢
星月不相逢 2021-02-06 12:09

I\'m looking for a way get the following from a users youtube name or url.

  1. thumbnail
  2. link to video on youtube.com
  3. Title of the video
3条回答
  •  Happy的楠姐
    2021-02-06 12:30

    Look at the code

    entry as $entry) {
          $media = $entry->children('media', true);
          $watch = (string)$media->group->player->attributes()->url;
          $thumbnail = (string)$media->group->thumbnail[0]->attributes()->url;
          ?>
          
    <?php echo $media->group->title; ?>

    group->title; ?>

    group->description; ?>

    '; $i=0; } } ?>

    Code is copied from the post SimpleXML loop works but breaks half way through

    It will get a users all youtube videos. Now it is very easy to develop your own. Know more about YouTube API from https://code.google.com/apis/youtube/2.0/reference.html

提交回复
热议问题