【问题标题】:get the number of youtube channel subscribers获取 youtube 频道订阅者的数量
【发布时间】:2012-09-28 08:55:26
【问题描述】:

我需要在我的 asp.net 网站上获取 youtube 频道的订阅者数量,我已经搜索了文档 (https://developers.google.com/youtube/2.0/developers_guide_protocol_activity_feeds),我知道我有把这个:

http://gdata.youtube.com/feeds/api/users/PageName

但即使我在浏览器中打开它也不会提供任何帮助,将不胜感激。

有没有我可以使用的特殊库或 api?

【问题讨论】:

    标签: asp.net youtube-api


    【解决方案1】:

    您可以执行以下操作:

    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 "";
                }
            }
    

    【讨论】:

    猜你喜欢
    • 2015-03-27
    • 1970-01-01
    • 2015-09-27
    • 2021-02-19
    • 2018-04-21
    • 2015-08-16
    • 1970-01-01
    • 2021-06-05
    • 1970-01-01
    相关资源
    最近更新 更多