Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How can i display the number of subscribers in my channels name?

$
0
0

I made a YouTube video which displays the number of subs i have in the title. For this, i used Google Apps Script and the following code: (i replaced the ID's with "..." for this question)

function updateTitle() {  var videoID = '...';   var part = 'snippet,statistics';  var params = {'id': videoID};  var response = YouTube.Videos.list(part, params);  var video = response.items[0];  var channelID = '...' ;   var part2 = 'snippet,contentDetails,statistics';  var params2 = {'id': channelID};  var response2 = YouTube.Channels.list(part2, params2);  var channel = response2.items[0];  var subscribers = channel.statistics.subscriberCount;  var videos = channel.statistics.videoCount;  var views = channel.statistics.viewCount;  var videoTitle = 'I have '+ subscribers +' subscribers...';  video.snippet.title = videoTitle;  try{    YouTube.Videos.update(video, part);  }catch(e){  }}

Now my question: Can i also do the same thing for the channel name, with a similar code? I mean, that the number of subs is displayed in my channels name?

Thanks for your help!


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>