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); } } }
public void addPersonMatch(BoxOfficeSearchResult match) { personMatches.Add(match); }
public void addMovieMatch(BoxOfficeSearchResult match) { movieMatches.Add(match); }