I have an Excel spreadsheet with a list of movies and tv shows. I have a script that will connect to [login to view URL] and pull meta information for movies based on the content in Cell A. The problem is, the script is unable to pull metadata for TV shows, and it also has some trouble with the titles and sometimes does not recognize it if the text isn't perfect.
Here is a sample of some of the titles.
28 Weeks Later
2 Guns 2013
30,000 Leagues Under The Sea 2007
300 Rise of an Empire 2014
30 Minutes Or Less 2011
30 Rock S01E01 Pilot
30 Rock S01E02 The Aftermath
What I need is the script modified so that it IF the title contains season and episode information it instead searches omdbapi using that information transposed from the title into something omdbapi can recognize.
I don't know the syntax but it would logically be something like:
IF title contains "s##*e##" then use "t=%s&season=%s&episode=%s" instead of searching by title only.
Here is a sample of a way to connect to the omdbapi for episode and season information.
"String url = "[login to view URL]";
String charset = "UTF-8";
String title = "Game of Thrones";
String season = "5";
String episode "5";
String query = [login to view URL]("t=%s&season=%s&episode=%s",
[login to view URL](title, charset),
[login to view URL](season, charset),
[login to view URL](episode, charset),);
URLConnection connection = new URL(url + "?" + query).openConnection();
[login to view URL]("Accept-Charset", charset);
InputStream response = [login to view URL]();
// Do some stuff with the data"