The script is designed to find movies currently playing in theaters in your area and create a Xlobby XML database file with the movie info including local theaters and showtimes, download coverart and stills, and provide links to trailers. The script takes country, zip code and radius as inputs. It uses regex to parse the pertinent movie information, coverart and showtimes from http://www.moviestickets.com. Stills are downloaded from http://www.movies.com, and trailer urls are parsed from Itunes.
This plugin is US, Canada, UK, and Ireland at this time (results are limited to whatever movietickets.com shows for you postal code). Instructions for installing the script are below. I’ve also updated Steven’s Simplicity Default skin to utilize the script as an example. The zip files are at the bottom of the post. Here are some screens shots:
Main screen:
Details screen:
Showtimes overlay:
Theaters overlay:
Purchase screen:
Progress Overlay:
---------------- InTheaters Installation Instructions -----------------
The script requires .NET 2.0!
This script utilizes the XScriptNG plugin written by spencer171. To call this script, install the XscriptNG plugin as described and located here:
http://www.xlobby.com/forum/viewtopic.php?t=4290
See the following post for additional required XscriptNG configuration:
http://www.xlobby.com/forum/viewtopic.p ... 994#p36994
If you want to test the script with Steven’s Simplicity Default skin download the updated skin files here:
http://home.comcast.net/~twhite644/inth ... eaters.zip
Unzip and copy the files to the locations indicated by the folders. Start Xlobby and hit F2 - select
Eventgroups\Skin\intheaters\Refresh intheaters - in the right hand window
change the countrycode~postalcode and radius variables to your location, close the event editor.
Valid country codes are US, UK, CA, IR. The parameter should be the country code followed by a ~ and then the postal code, a space and then search radius in miles ie:
- US~77004 10
UK~M15~4W 20
CA~l9b~2m5 15
IR~15 20
Irish counties need to be designated using the MovieTickets.com county number:
County Armagh=1
County Carlow=2
County Cavan=3
County Clare=4
County Cork=5
County Donegal=6
County Dublin=7
County Galway=8
County Kerry=9
County Kildare=10
County Kilkenny=11
County Laois=12
County Leitrim=13
County Limerick=14
County Longford=15
County Louth=16
County Mayo=17
County Monaghan=18
County Offaly=19
County Sligo=20
County Tipperary=21
County Tyrone=22
County Waterford=23
County Westmeath=24
County Wexford=25
County Wicklow=26
From the Xlobby main menu hit the "Movies" button and then the
"In Theaters" button and then "Refresh". Stop and start Xlobby after the refresh has finished.
To integrate InTheaters into another skin follow the instructions below…
Download and install the InTheaters_GetMovies script here: http://home.comcast.net/~twhite644/inth ... movies.zip
Unzip the script and copy the text file to your Xlobby\plugins\Xscript\Scripts directory.
The script will automatically determine the path to your Xlobby folder, you should NOT need to modify it, but if you do... Search for the following at the start of the Main subroutine:
Dim XLpath_str as string = ""
Add your path without a trailing \.
Once you have the script in place start Xlobby and hit F2 -select Eventgroups, add a group called "InTheaters"
to your skin and inside that create an event called "Update InTheaters". Select “plugin” in the right hand window,
choose “executescript” and put the following in parameters.
- Code: Select all
intheaters_getmovies.txt COUNTRYCODE~POSTALCODE RADIUS
Where COUNTRYCODE is: US, CA, UK, or IR. POSTALCODE is your zip code in the US, postal code with a ~ in place of the space for Canada and the UK, or the proper County # for Ireland (see above for County/# associations). Valid Values for RADIUS are 5,10,15,20,25.
(Note: Canadian and UK postal codes should be input with "~" in place of the space ie "V69~J4H").
Execute the "Update InTheaters" event. The script will begin spidering for the information on current movies in your area from MovieTickets.com. A "intheaters" directory will be created in the Xlobby root directory that will contain a folder for each movie. Stills and coverart will be downloaded and stored in the folder for their respective movies. The script will check to see if the files already exist to reduce bandwidth on subsequent runs. A cleanup routine runs at the end of the script to delete folders for movies that are no longer showing. Once the script has completed spidering for all movies it will write the output file to Xlobby\plugins\Xscript\Scripts directory as intheaters.xml. The previous intheaters.xml file in Xlobby\databases will be renamed to intheaters.xml.old if it exists and the new file will be copied into the databases directory. Finally, a category refresh will be performed for the Xintheaters category within xlobby.
After the first run you need to close Xlobby and restart so the database can be initialized, this only needs to be done once.
To view the intheaters data:
Create a new screen for InTheaters (I would suggest cloning your movies screen (and any associated screens/overlays) as the template.
Name the category "Xintheaters" and set the database to "intheaters".
**** NOTE! THESE NAMES ARE NOT OPTIONAL!!!!!! *****
You can access the data using "category>Xintheaters>variablename"
************************************************************************
InTheaters.xml Variables
************************************************************************
- parameter - movietickets.com url (for internal use)
coverart - downloaded coverart
display - movie title
title - movie title
sorttitle - title adjusted for "The", "A", "An"
rating - movietickets.com full rating
filterrating - short rating for searches
director
actors
genre
runtime
plot
showtimes - text view of theaters and their associated showtimes
trailerurl - Itunes url of trailer (if trailers are enabled)
traileravail - configurable variable for indicating trailer found status
theaternames - list of theaters for searches
showtimeslist - list of showtimes for searches
- theater - theater name for subitem
showtime - subitems for each theater/showtimes
purchaselink - MovieTickets.com ticket purchase link if available
purchaseavail - configurable variable for indicating purchase availability
************************************************************************
SCRIPT OPTIONS
************************************************************************
The script allows you to set several options, they are described below. To
change the options in the script, open it in Notepad and search for:
"Script Options are delimited below!"
Modify the options based on your config and desires...
************************************************************************
Xlobby Path Option:
The script will automatically determine your Xlobby path, you should NOT need to modify it, but if you do change the value below for XLpath_str. Note: no trailing \ is needed.
InTheaters Path Option:
The InTheaters path can be modified to the location you wish
to have the stills, and coverart downloaded too. The default is the root of your Xlobby folder. You can specify a specific local path or you can specify a network share such as
"\\server1\sharename" (No trailing \ is needed). The script will create
a directory called "intheaters" at the specified path.
Dim XLpath_str As String = ""
Dim InTheaterspath_str As String = ""
**********************************************************************
Timout Option:
A timeout value is available for slower internet connections, this is
the time the script will wait for a response from a website in milliseconds.
Slower internet connections may need a higher value.
Timeout = 10000
**********************************************************************
Get Trailers Option:
GetTrailersVal is dimmed below, if this is set to 1 then the script will try to get trailer URL's from Itunes. Set value to 0 to disable.
FuzzyMatch will use the Levenshtein Distance fuzzy string matching algorithm to try and match trailers when an exact match fails. This helps when Itunes fat fingers a movie title. Set value to 0 to disable.
TrailerSize can be set to the max size trailer link desired. Valid values are "IPod", "Small", "Medium", "Large", "HD 480", "HD 720", "HD 1080".
If the specified size is not available the script will link to the next largest available link unless only a single link is available.
TrailerIsAvail_str and TrailerNotAvail_str can be set by the user to determine what is displayed in the %traileravail% variable. This can be simple text or an image (ie "skin://buttons/TrailerIsAvail.png")
Dim GetTrailersVal As Integer = 0
Dim FuzzyMatch as Integer = 1
TrailerSize="Large"
Dim TrailerIsAvail_str as String = "skin://buttons/TrailerIsAvail.png"
Dim TrailerNotAvail_str as String = "skin://buttons/TrailerNotAvail.png"
**********************************************************************
Get Stills Option:
The script will download stills for the movie by default. If you don't use stills then set the value to 0 to disable.
MaxStills can be used to limit the number of stills downloaded per movie.
Dim GetStills As Integer = 1
Dim MaxStills as Integer = 99
**********************************************************************
HQ Coverart Option:
The script gets low quality coverart from movietickets.com by default. If this option is set to 1 then the script will do it's best to download high
quality coverart from impawards.com. Leave value to 0 if you just want the low quality movietickets.com coverart which is guaranteed to be correct when available.
Dim HQ As Integer = 0
'**********************************************************************
Purchase Availability Option:
PurchaseIsAvail_str and PurchaseNotAvail_str can be set by the user
to determine what is displayed in the %purchaseavail% variable for
individual showtime subitems. This can be simple text or an
image (ie "skin://buttons/TrailerIsAvail.png")
Dim PurchaseIsAvail_str As String = "Available"
Dim PurchaseNotAvail_str As String = "Not Available"
'**********************************************************************
Extended Searching Option:
Extended searching is configured below. If Extended is set to 1 the script will try searching other sites for movie info & stills that are not available from the default movietickets.com and movies.com. Default is 0, or disabled. NOTE: This functionality is still be debugged - IMDB should be working though.
Dim Extended as Integer = 0
'Individual sites for extended searching can be enabled (1) or
'disabled (0) below:
Dim Extended_IMDB as Integer = 0
Dim Extended_IndiaFM as Integer = 0
Dim Extended_IMAX as Integer = 0
'**********************************************************************
Display Progress Option:
The script is set up to display a progress overlay if you want to see
how the script is running. Movies.com can be a little tempermental so
I personally think its a good idea. You can turn this feature on
and off by setting the following variable in the Script Options section
of the code. Setting DisplayProgress to 1 enables it, set it to 0 if you
dont want to see the progress:
DisplayProgress = 1
The overlay screen name can also be changed with the variable:
ProgressOverlay = "intheaters_progress"
The variables for display on your progress overlay screen are:
%variable>progover% - Overall script progress text
%variable>progbarover% - overall progress delimiter text "...."
%variable>progtext% - Movie progress text
%variable>progbar% - movie progress delimiter text "...."
*** NOTE: This Overlay will Automatically close at the end of the script,
there is no need to have a close button on it!
************************************************************************
Thats it for the current Script Options
************************************************************************
Note - the script writes a debug log to the Xlobby\Plugins\Xscript\Scripts
directory called "intheaters_debug.log".
************************************************************************
End Documentation
************************************************************************
Revisions:
v1.1 03/30/2006 - I had a chance to work on the script and switch it over to using movietimes pages on movies.com instead of flickfinder. I also added some code for IMAX movies (if you have a IMAX theater near you) to pull info from http://www.bigmoviezone.com.
v1.2 04/09/2006 - Fixed problem with bad folder names. Update IMAX movie section. Updated trailers with new regex.
v1.3 04/10/2006 - Added error handling for folder paths.
v1.4 04/30/2006 - Fixed sorttitle code for movies with short names.
v1.5 04/30/2006 - Added better error handling for folder paths...
v2.0 05/27/2006 - Switched to MovieTickets.com as the source, updated documentation with new input parameter info (please read - things have changed!)
v2.1 05/27/2006 - Added High Quality coverart option
v2.2 06/03/2006 - Added error handling for Ads from movietickets.com, modified showtime regexes to fix certain scenarios
v2.3 07/01/2006 - Modified showtime code for movies with no showtimes, fixed regex for stills from movies.com.
v2.4 11/11/2006 - Fixed the showtime regexes to fix the problem that Zap found with abnormal purchase links.
v2.5 12/09/2006 - Fixed the stills code.
v5.1 02/18/2007- Major Update!
- XScriptNG now required!!!!!
- Parameter variable now contains link to MovieTickets.com url for the movie (internal use)
- Trailers now pulled from Itunes
- Fuzzy matching of trailer names using Levenshtein Distance
- TrailerSize can be set to the max size trailer link desired. Valid values are "IPod", "Small", "Medium", "Large", "HD 480", "HD 720", "HD 1080". If the specified size is not available the script will link to the next largest available link unless only a single link is available.
- New "TrailerURL" variable: for link to Itunes trailer url; replaces previous "trl_small", "trl_medium", "trl_large" variables
- New "TrailerAvail" variable: TrailerIsAvail_str and TrailerNotAvail_str script options can be set by the user to determine what is displayed in the %traileravail% variable. This can be simple text or an image (ie "skin://buttons/TrailerIsAvail.png")
- Database is now multi-level with subitems for each theater and showtime per movie (see the screenshot of the "Theaters" view).
- New "PurchaseLink" variable: Movietickets.com online purchase url for individual showtime if available
- New "PurchaseAvail" variable: PurchaseIsAvail_str and PurchaseNotAvail_str can be set by the user to determine what is displayed in the %purchaseavail% variable for individual showtime subitems. This can be simple text or an image (ie "skin://buttons/TrailerIsAvail.png")
- New MaxStills option can be used to limit the number of stills downloaded per movie (default = 99).
- Extended searching option is now available. If Extended is set to 1 the script will try searching other sites for movie info & stills that are not available from the default movietickets.com and movies.com. Default is 0, or disabled. Individual sites for extended searching can be enabled (1) or disabled (0) for IMDB, IndiaFM, and BigMovieZone (IMAX). NOTE: This feature has not been completely debugged.
- New "filterrating" variable: short rating for searches
- New "theaternames" variable: for filtering on theaters
- New "showtimeslist" variable: for filtering on showtimes
v5.2 03/03/2007 - Updated movie title regex to reflect change at MovieTickets.com.
v5.5 06/06/2007 - Updated movies.com and indiafm.com code.
v5.6 06/15/2007 - Updated trailers code exception handling.
v5.9 09/01/2007 - Updated trailers code to match Itunes backend change. Updated IMDB extended searching code.
v6.1 12/29/2007 - Updated movie title regex to reflect change at MovieTickets.com. Updated IMDB extended searching code.
v6.2 01/01/2008 - Updated coverart regexs for MovieTickets.com and Impawards.com.
v6.3 01/19/2008 - Fixed problem with Extended Search code and added some more error handling.
v6.5 02/24/2008 - More error handling for showtimes and updated IMDB extended search code.
That’s it for now – let me know if you run into any problems!
Good luck,
tsw