私のasp.net WebサイトでYouTubeチャンネルの購読者数を取得する必要があります. :
http://gdata.youtube.com/feeds/api/users/PageName
しかし、ブラウザで開いても何も提供されず、何の助けも開かれません。
使用できる特別なライブラリまたは API はありますか?
私のasp.net WebサイトでYouTubeチャンネルの購読者数を取得する必要があります. :
http://gdata.youtube.com/feeds/api/users/PageName
しかし、ブラウザで開いても何も提供されず、何の助けも開かれません。
使用できる特別なライブラリまたは API はありますか?
できることは次のとおりです。
System.Net.WebClient wb = new System.Net.WebClient();
string str = wb.DownloadString("http://gdata.youtube.com/feeds/api/users/TheNewYorkTimes");
Response.Write(getCount(str));
public static string getCount(string video)
{
if (video.Contains("="))
{
string str = "subscriberCount='";
string videoid = video.Substring(video.IndexOf("subscriberCount") + str.Length);
if (videoid.Contains("'"))
{
videoid = videoid.Remove(videoid.IndexOf("'"));
return videoid;
}
else
{
return "";
}
}
else
{
return "";
}
}