How to know the number of subscribers

Asked

Viewed 1,512 times

0

In c# I will develop an application to control views and subscribers of my channel...

I tried to enter this code:

static long Inscritos(string youtube_addr){
var wb=new WebBrowser();
wb.Navigate(youtube_addr); // Sendo http://youtube.com/user/meu_canal/about

var countAll = wb.Document.getElementsByTagName('b')[0];
retun Convert.ToInt64(countAll);

There at the time I call MessageBox.Show(Inscritos('http://youtube.com/user/malena010102/about').ToString());

the result is a blank text!

  • 2

    You’re picking up the contents of a tag bold? The first page is the counter? You know this is pretty unreliable? Youtube doesn’t have an official API? If you want to insist on this, consider taking tag with class about-stat and within it take what is in <b>. But I think this kind of class you’re using doesn’t allow it directly. Then you’d have to hunt, there might be ambiguity. That is, it is not easy to succeed. Maybe this helps: http://htmlagilitypack.codeplex.com/

  • https://developers.google.com/youtube/v3/docs/subscriptions/list

No answers

Browser other questions tagged

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