How To Automatically Display Views & Likes In Youtube Video Title!

Hello Readers,

I hope you are doing well.

So you want to automate your youtube title??

Ofcourse yes...that is why you are here..right?

It is very easy to do it. Here is how you can do it.

So in order to automate your youtube video title you need to follow these 10 steps only:

Step 1: Go to you youtube studio and copy the link of the video you want to automate the title

Step 3: On the left side of http://script.google.com/ page, you will find an option to create new project.
             Go to 'New Project' Button.

Step 4: Then Go to 'Advanced Google Services' under Resources tab. It require you to enter your project name first.

Step 5: Then wait for 5-10 seconds so that, it synchronize. Then 'turn on' Youtube Data API.

Step 6: Then Copy- paste the following code:
function updateTitle() {
  var videoID = 'vT5wcz08af8';  //https://youtu.be/vT5wcz08af8
  var part = 'snippet,statistics';
  var params = {'id': videoID};
  var response = YouTube.Videos.list(part, params);
  var video = response.items[0];
  var videoViewsCount = video.statistics.viewCount;
  var videoLikeCount = video.statistics.likeCount;
  var videoDislikeCount = video.statistics.dislikeCount;
  var videoCommentCount = video.statistics.commentCount;
  var videoTitle = 'OMG This video has ' + videoViewsCount + ' views and ' + videoLikeCount + ' likes and ' + videoDislikeCount + ' dislikes and ' + videoCommentCount + ' comments!!!';
  video.snippet.title = videoTitle;
    YouTube.Videos.update(video, part);

Step 7: It is the most important step. You need to edit line number 2 i.e. your personal youtube video link suffix. In my case my video link is 'https://youtu.be/vT5wcz08af8 ' and suffix is 'vT5wcz08af8'.

Step 8: Then run for the first time by pressing the 'run' button

Step 9: Then click on 'Review Permission'

Step 10. Then select your channel and press 'Allow'

Step 11: That it. Done. Your code will work perfectly fine.

I hope this blog helped you. 

Please comment your views.

Thank you.

Post a Comment