Beispiel #1
0
        public static TitlingResult YoutubeWithDuration(TitlingRequest req, string htmlDoc)
        {
            // If duration can be found, change the html info to include that.
            var ytTime = WebTools.GetYoutubeTime(htmlDoc);

            req.IrcTitle.SetHtmlTitle().AppendTime(ytTime);

            return(req.CreateResult(true));
        }
Beispiel #2
0
    public override string FormatTitle(SearchResult result)
    {
        var ytPage = WebString.Download(result.Address);

        if (ytPage.Success)
        {
            var duration = WebTools.GetYoutubeTime(ytPage.Document);
            if (duration > TimeSpan.Zero)
            {
                return(string.Format("{0} [{1}]",
                                     base.FormatTitle(result),
                                     Format.Duration(duration)));
            }
        }

        return(base.FormatTitle(result));
    }