public override int DiscoverSubCategories(Category parentCategory)
{
int dynamicSubCategoriesCount = 0;
RssLink category = (RssLink)parentCategory;
String baseWebData = GetWebData(category.Url, forceUTF8: true);
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
document.LoadHtml(baseWebData);
HtmlAgilityPack.HtmlNodeCollection shows = document.DocumentNode.SelectSingleNode("//div[@id='programmeAlphabetContent']").SelectNodes(".//li[not(span[@class='labelBonus'])]");
if (shows.Count > 0)
{
category.SubCategories = new List<Category>();
foreach (var show in shows)
{
HtmlAgilityPack.HtmlNode link = show.SelectSingleNode("a");
String showUrl = link.Attributes["href"].Value;
String showTitle = link.InnerText;
String showDescription = link.Attributes.Contains("title") ? link.Attributes["title"].Value : String.Empty;
category.SubCategoriesDiscovered = true;
category.SubCategories.Add(
new RssLink()
{
Name = showTitle,
HasSubCategories = false,
Url = Utils.FormatAbsoluteUrl(showUrl, CeskaTelevizeUtil.baseUrl),
Description = OnlineVideos.Helpers.StringUtils.PlainTextFromHtml(showDescription)
});
dynamicSubCategoriesCount++;
}
}
return dynamicSubCategoriesCount;
}