예제 #1
0
        /// <summary>
        /// Returns a MovieSearchResults object with the amount of results found and the results.
        /// </summary>
        /// <param name="query">Search term</param>
        /// <param name="pageLimit">Amount of result pages to load</param>
        /// <returns>MovieSearchResults object</returns>
        public TomatoMovieSearchResults FindMovieByQuery(string query, int pageLimit = 10)
        {
            var url          = String.Format(MOVIE_SEARCH, ApiKey, query, pageLimit);
            var jsonResponse = GetJsonResponse(url);

            return(TomatoParser.ParseMovieSearchResults(jsonResponse));
        }
예제 #2
0
        /// <summary>
        /// Returns a Movie object with fields populated with relevant data.
        /// </summary>
        /// <param name="movieId">RottenTomatoes unique ID number.</param>
        /// <returns>Movie object.</returns>
        public TomatoMovie FindMovieByImdbId(string imdbId)
        {
            var url          = String.Format(MOVIE_BY_IMDB, ApiKey, imdbId);
            var jsonResponse = GetJsonResponse(url);

            return(TomatoParser.ParseMovie(jsonResponse));
        }
예제 #3
0
        /// <summary>
        /// Returns a Movie object with fields populated with relevant data.
        /// </summary>
        /// <param name="movieId">RottenTomatoes unique ID number.</param>
        /// <returns>Movie object.</returns>
        public TomatoMovie FindMovieById(int movieId)
        {
            var url          = String.Format(MOVIE_INDIVIDUAL_INFORMATION, ApiKey, movieId);
            var jsonResponse = GetJsonResponse(url);

            return(TomatoParser.ParseMovie(jsonResponse));
        }
예제 #4
0
        /// <summary>
        /// Gets a list of opening movies.
        /// </summary>
        /// <returns>MovieSearchResults</returns>
        public TomatoMovieSearchResults FindOpeningMoviesList()
        {
            var url          = string.Format(LIST_OPENING_SOON, ApiKey);
            var jsonResponse = GetJsonResponse(url);
            var results      = TomatoParser.ParseMovieSearchResults(jsonResponse);

            return(results);
        }
예제 #5
0
        /// <summary>
        /// Gets a list of Movies currently in theaters.
        /// </summary>
        /// <returns>MovieSearchResults</returns>
        public TomatoMovieSearchResults FindMoviesInTheaterList()
        {
            var    url          = string.Format(LIST_IN_THEATERS, ApiKey);
            string jsonResponse = GetJsonResponse(url);
            var    results      = TomatoParser.ParseMovieSearchResults(jsonResponse);

            return(results);
        }
예제 #6
0
        /// <summary>
        /// Gets a list of Movies currently at the top in the Box Office.
        /// </summary>
        /// <returns>MovieSearchResult object</returns>
        public TomatoMovieSearchResults FindBoxOfficeList()
        {
            var    url          = string.Format(LIST_BOX_OFFICE, ApiKey);
            string jsonResponse = GetJsonResponse(url);
            var    results      = TomatoParser.ParseMovieSearchResults(jsonResponse);

            return(results);
        }
예제 #7
0
        /// <summary>
        /// Gets a list of upcoming movies.
        /// </summary>
        /// <returns>MovieSearchResults</returns>
        public TomatoMovieSearchResults FindUpcomingMoviesList()
        {
            var url          = string.Format(LIST_UPCOMING, ApiKey);
            var jsonResponse = GetJsonResponse(url);
            var results      = TomatoParser.ParseMovieSearchResults(jsonResponse);

            return(results);
        }