Exemplo n.º 1
0
        private void extractMovieMatches()
        {
            Match match = Regex.Match(website, movieMatchesRegex);
            if (!match.Success) {
                return;
            }
            string table = match.Value;
            MatchCollection rowMatches = Regex.Matches(table, tableRowRegex);
            foreach (Match rowMatch in rowMatches) {
                BoxOfficeSearchResult r = new BoxOfficeSearchResult();

                string row = rowMatch.Value;

                Match idMatch =  Regex.Match(row, boxofficeIdRegex);
                r.boxofficeID = idMatch.Groups["id"].Value;
                r.name = idMatch.Groups["name"].Value.Trim();

                Match releaseDateMatch = Regex.Match(row, releaseDateRegex);
                r.release = releaseDateMatch.Groups["date"].Value;

                Match imgMatch = Regex.Match(row, coverURLRegex);
                if (imgMatch.Success) {
                    JobLoadImage job = new JobLoadImage(imgMatch.Groups["url"].Value, null);
                    job.run();
                    r.cover = job.getResult();
                }

                if (r.name != null && !r.name.Trim().Equals(string.Empty) && r.boxofficeID != null && !r.boxofficeID.Trim().Equals(string.Empty)) {
                    result.addMovieMatch(r);
                }

            }
        }
Exemplo n.º 2
0
 private JobLoadImage getPictureLoadJob()
 {
     Match m = Regex.Match(mainPage, mediaURLRegex);
     imageURL = m.Groups["url"].Value + ".jpg";
     JobLoadImage imageLoadJob = new JobLoadImage(imageURL, null);
     return imageLoadJob;
 }