Ejemplo n.º 1
0
        public static string GetPlot(string Title)
        {
            // This method runs an API query to retrive the plot description.
            string url = "http://www.omdbapi.com/?t=" + Title.Trim();

            using (WebClient wc = new WebClient())
            {
                var json = wc.DownloadString(url);
                JavaScriptSerializer oJS = new JavaScriptSerializer();
                ImdbEntity           obj = new ImdbEntity();
                obj = oJS.Deserialize <ImdbEntity>(json);
                if (obj.Response != null)
                {
                    Plot = obj.Plot;
                }
            }
            return(Plot);
        }
Ejemplo n.º 2
0
        public static string GetPosterURL(string Title)
        {
            // This method runs an API query to retrieve the URL for the poster of each film.
            string url = "http://www.omdbapi.com/?t=" + Title.Trim();

            using (WebClient wc = new WebClient())
            {
                var json = wc.DownloadString(url);
                JavaScriptSerializer oJS = new JavaScriptSerializer();
                ImdbEntity           obj = new ImdbEntity();
                obj = oJS.Deserialize <ImdbEntity>(json);
                if (obj.Response != null)
                {
                    PosterURL = obj.Poster;
                }
            }
            return(PosterURL);
        }