Video API - How to automatically update your posts?

Asked

Viewed 282 times

2

Is there any Video API for Youtube and Vimeo that can be embedded, through a script , on a website and that gives me the condition to automatically update the posts made?

  • 2

    Does this answer help? are you looking for? http://answall.com/questions/5692/update-automatic-video-postedyoutube

  • Is the problem solved? Can you give some feedback on the suggestions you received here? Otherwise, I’m afraid the question is unclear, and you need to complete it with more information.

1 answer

0


Yes, it has its own Youtube API. It is available at this link: https://developers.google.com/youtube/? hl=en

I did one of these on Rede TV Rondônia. It was like this:

function showVideosShopTV( data ) {
  var feed = data.feed;

  var entries = feed.entry || [];

  // console.log(entries)

  var html = ['<ul class="videos-shop-tv-container">'];

  for (var i = 0; i < entries.length; i++) {
    var entry = entries[i];
    var title = entry.title.$t;
    var link = entry.link[0].href;
    var thumbnailUrl = entries[i].media$group.media$thumbnail[0].url;
    var datetime = new Date(entry.published.$t);

    html.push('<li>', '<div class="thumb video"><a class="borda-interna vc modal-video-link-shoptv" data-share-link="', link ,'" data-title="', title ,'" href="', link ,'"><img src="', thumbnailUrl, '" width="220" height="165" /></a></div><div style="color: #999; font-size: 12px; line-height: 18px; text-align: left;">',datetime.getDate() + '/' + datetime.getMonth() + '/' + datetime.getFullYear(),'</div><div style="overflow-wrap: break-word;" class="title-videos">', title, '</div></li>');
  }
  document.getElementById('videos-shop-tv-container').innerHTML = html.join('');
}

<script type="text/javascript" src="http://gdata.youtube.com/feeds/users/ShopTVRondonia/uploads?alt=json-in-script&callback=showVideosShopTV&max-results=20&orderby=published&time=this_week&format=5"></script>

I just couldn’t get him to take the Alectory videos. To do this create a function to make the list of videos random.

But it’s a start.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.