- May 17, 2011
- 396
- 136
- Home Country
- Canada
Edit
Just to let everyone know, I've abandoned Comedy Network for now and concentrating on other CTV stations at the moment. Sites based on CTV platform are now working.
What do I need my class to do for it to appear in the Site Util drop-down? Any pointers?
Code looks like this, so far:
I have copied the 2 dlls to the plugins\Windows\OnlineVideos directory. However, OnlineVideos configuration is not showing ComedyNetwork in the drop-down.
Thanks in advance.
So, I have a Visual C# project set up. I can create OnlineVideos.dll and OnlineVideos.Sites.doskabouter.dll.I have downloaded Visual Studio Express on my VMWare partition, so I'll see if I can make a fool of myself with my C# skills. I will try and use CBCUtil as a base and see what happens.
Cheers.
What do I need my class to do for it to appear in the Site Util drop-down? Any pointers?
Code looks like this, so far:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
namespace OnlineVideos.Sites
{
class ComedyNetworkUtil : SiteUtilBase
{
private string baseUrl = @"http://watch.thecomedynetwork.ca";
private Regex categoryRegex = new Regex(@"<li[^>]*>\s*<a\sid=""(?<id>[^""]*)""\sonclick=""[^""]*""\shref=""(?<url>[^""]*)""\stitle=""[^""]*"">\s*(?<title>[^<]*)<span></span>\s*</a>\s*</li>",
RegexOptions.Compiled);
public override int DiscoverDynamicCategories()
{
Settings.Categories.Clear();
string webData = GetWebData(baseUrl + @"/AJAX/VideoLibraryWithFrame.aspx");
if (!string.IsNullOrEmpty(webData))
{
Match m = categoryRegex.Match(webData);
while (m.Success)
{
RssLink cat = new RssLink();
cat.Name = HttpUtility.HtmlDecode(m.Groups["title"].Value);
cat.Url = HttpUtility.HtmlDecode(m.Groups["url"].Value);
cat.Thumb = HttpUtility.HtmlDecode(m.Groups["id"].Value);
Settings.Categories.Add(cat);
m.NextMatch();
}
}
Settings.DynamicCategoriesDiscovered = true;
return Settings.Categories.Count;
}
public override int DiscoverSubCategories(Category parentCategory)
{
return base.DiscoverSubCategories(parentCategory);
}
public override List<VideoInfo> getVideoList(Category category)
{
return new List<VideoInfo>();
}
}
}
Thanks in advance.