BlogSharp.Core.Impl.Plugins.Pingback.PingbackService.GetPingbackUrl C# (CSharp) Method

GetPingbackUrl() protected method

protected GetPingbackUrl ( string link ) : string
link string
return string
        protected virtual string GetPingbackUrl(string link)
        {
            var pageContent = this.httpClient.DownloadString(link);
            if (!string.IsNullOrEmpty(pageContent))
            {
                string pat = "<link rel=\"pingback\" href=\"([^\"]+)\" ?/?>";
                Regex reg = new Regex(pat, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                Match m = reg.Match(pageContent);
                if (m.Success)
                {
                    return m.Result("$1");
                }
            }
            return null;
        }