Exemplo n.º 1
0
        private void getmetaButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (ListBoxItem item in episodeHolder.Items)
            {
                try
                {
                    HTMLExtractor htmlExtractor = new HTMLExtractor(item.Content.ToString());

                    MetaCollector metaCollector = htmlExtractor.MetaCollector;

                    MetaAssembler metaAssembler = new MetaAssembler(metaCollector, item, SeasonCheckBox, EpisodeNumberCheckBox, EpisodeNameCheckBox);

                    SeriesName.Text = metaCollector.SeriesName;
                }
                catch (Exception)
                {
                    // Now who is the boss
                }
            }
        }
        public HTMLExtractor(string passedURL)
        {
            URL = passedURL;

            SiteName = SiteDetector(URL);

            using (WebClient client = new WebClient()) // WebClient class inherits IDisposable
            {
                HTML = client.DownloadString(URL);
            }

            if (SiteName.ToLower() == "imdb")
            {
                IMDB imdb = new IMDB(HTML);
                MetaCollector = new MetaCollector(imdb);
            }
            else
            {
                TV tv = new TV(HTML);
                MetaCollector = new MetaCollector(tv);
            }
        }