Exemplo n.º 1
0
        public void CreateFeedList(PodcastFeed podcastFeed)
        {
            var feedTab = new TabPage();

            tabCtrlFeeds.TabPages.Add(feedTab);

            var feedList = new ListBox();

            feedList.Dock = DockStyle.Fill;
            feedTab.Controls.Add(feedList);

            var rss  = WebFetcher.FetchRss(podcastFeed.Url);
            var feed = RssParser.GetPodcastFeed(rss);

            podcastFeed.PodcastEpisodes = feed.PodcastEpisodes;
            feedTab.Text = podcastFeed.Name;

            foreach (PodcastEpisode podcast in podcastFeed.PodcastEpisodes)
            {
                feedList.Items.Add(podcast.Name);
            }

            ActiveRss.Add(podcastFeed.Id, rss);
            TabPages.Add(podcastFeed.Id, feedTab);
            UpdateClocks.Add(podcastFeed.Id, new UpdateClock(podcastFeed));

            SetUpdateClocks();
            UpdateClocks[podcastFeed.Id].Start();
        }
Exemplo n.º 2
0
        public ContentDirectoryMovieTrailers(string aDataPath, IContentDirectorySupportV2 aSupport)
        {
            string installPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            iWebFetcher = new WebFetcher(aDataPath);

            iPodcast = new Podcast(iWebFetcher, installPath, aSupport);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // The code provided will print ‘Hello World’ to the console.
            // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
            We webFetcher = new WebFetcher();

            Console.WriteLine(webFetcher.Fetch("https://avia.yandex.ru/?win=309&clid=2256434-306&utm_source=distribution&utm_medium=bookmark&utm_campaign=ru"));

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
Exemplo n.º 4
0
        //Returns true if a new version of the feed is found, otherwise false
        private bool CheckForUpdate(PodcastFeed podcastFeed)
        {
            var rss = WebFetcher.FetchRss(podcastFeed.Url);

            if (rss.Content == ActiveRss[podcastFeed.Id].Content)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 5
0
        public Podcasts(WebFetcher aWebFetcher, string aAlbumArtUri)
        {
            iWebFetcher  = aWebFetcher;
            iAlbumArtUri = aAlbumArtUri;

            iMetadata       = new container();
            iMetadata.Id    = "podcasts";
            iMetadata.Title = "Podcasts";
            iMetadata.AlbumArtUri.Add(aAlbumArtUri);

            iShows = new List <PodcastShow>();

            iWebFile = iWebFetcher.Create(new Uri("http://wfmu.org/podcast"), "podcasts.xml", 60);
            iWebFile.EventContentsChanged += WebFileContentsChanged;
            iWebFile.Open();
        }
Exemplo n.º 6
0
        public Podcast(WebFetcher aWebFetcher, string aInstallPath, IContentDirectorySupportV2 aSupport)
        {
            iTrailers = new List <Trailer>();

            iWebFetcher = aWebFetcher;

            iWebFile = iWebFetcher.Create(new Uri(kAppleTrailersHiResUri), "podcasts.xml", 60);
            iWebFile.EventContentsChanged += WebFileContentsChanged;
            iWebFile.Open();

            string movieTrailerLogo = aSupport.VirtualFileSystem.Uri(Path.Combine(aInstallPath, "MovieTrailers.png"));

            iMetadata       = new container();
            iMetadata.Id    = "movietrailers";
            iMetadata.Title = "Movie Trailers";
            iMetadata.AlbumArtUri.Add(movieTrailerLogo);
            iMetadata.ChildCount = 0;
        }
Exemplo n.º 7
0
        internal PodcastShow(string aId, string aName, string aAlbumArtUri, WebFetcher aWebFetcher)
        {
            iId          = aId;
            iName        = aName;
            iAlbumArtUri = aAlbumArtUri;
            // iAlbumArtUri = "http://wfmu.org/podcast_images/" + iId.ToLower() + "_rss.png";
            iWebFetcher = aWebFetcher;

            iMetadata       = new container();
            iMetadata.Id    = iId;
            iMetadata.Title = iName;
            iMetadata.AlbumArtUri.Add(iAlbumArtUri);

            iEpisodes = new List <PodcastEpisode>();

            iWebFile = iWebFetcher.Create(new Uri("http://wfmu.org/podcast/" + iId + ".xml"), iId + ".xml", 60);
            iWebFile.EventContentsChanged += WebFileContentsChanged;

            iWebFile.Open();
        }
Exemplo n.º 8
0
        public ContentDirectoryWfmu(string aDataPath, IContentDirectorySupportV2 aSupport)
        {
            iSupport    = aSupport;
            iOptionPage = new OptionPage("Wfmu");

            string installPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            iWebFetcher = new WebFetcher(aDataPath);

            string wfmuLogo = aSupport.VirtualFileSystem.Uri(Path.Combine(installPath, "Wfmu.png"));

            iLive     = new Live(wfmuLogo);
            iPodcasts = new Podcasts(iWebFetcher, wfmuLogo);

            iMetadata       = new container();
            iMetadata.Id    = "wfmu";
            iMetadata.Title = "WFMU";
            iMetadata.AlbumArtUri.Add(wfmuLogo);
            iMetadata.ChildCount = 2;
        }
Exemplo n.º 9
0
        public ContentDirectoryShoutcast(string aDataPath, IContentDirectorySupportV2 aSupport)
        {
            iSupport    = aSupport;
            iOptionPage = new OptionPage("Shoutcast");

            string installPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            iAlbumArtUri = aSupport.VirtualFileSystem.Uri(Path.Combine(installPath, "Shoutcast.png"));

            iStations = new List <LiveStation>();

            iMetadata       = new album();
            iMetadata.Id    = "shoutcast";
            iMetadata.Title = "Shoutcast";
            iMetadata.AlbumArtUri.Add(iAlbumArtUri);

            iWebFetcher = new WebFetcher(aDataPath);

            iWebFile = iWebFetcher.Create(new Uri("http://yp.shoutcast.com/sbin/newxml.phtml?search=radio&br=320&mt=audio/mpeg"), "stations.xml", 60);
            iWebFile.EventContentsChanged += WebFileContentsChanged;
            iWebFile.Open();
        }
Exemplo n.º 10
0
 public override Task InitializeDataProviderAsync(IAnalogyLogger logger)
 {
     Featcher = new WebFetcher();
     return(base.InitializeDataProviderAsync(logger));
 }