xInTheaters v1.5 - 09/28/2008

Xlobby plugin development

xInTheaters v1.5 - 09/28/2008

Postby tswhite70 on Sun Jun 01, 2008 10:09 pm

Intheaters plugin via Xscript has now become the xInTheaters plugin. I've been working on the new plugin version for a while now, to the point where I can't remember what changes are in the plugin versus the script, so I'm abandoning the script version. I have not done a whole lot of testing other than running the plugin every Friday to pick the weeks movies but it seems to working ok, let me know if you run into any issues. See farther down for the new config information...

The plugin 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 plugin 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 plugin are below. Here are some screens shots:

Main screen:
Image

Details screen:
Image

Showtimes overlay:
Image

Theaters overlay:
Image

Purchase screen:
Image

Progress Overlay:
Image

---------------- xInTheaters Installation Instructions -----------------

Download the plugin here, unzip and place the xInTheaters.dll in your Xlobby\Plugins folder.
Start Xlobby and hit F2 - select Plugins - highlight the xInTheaters plugin in the right hand window and click Configure. The config should be pretty self explanatory for those that have used the old script.

Config Screen:
Image
Select your country, type in your postal code, select a radius for theaters and click the Edit Theaters button. The theaters config screen will open. Note: Irish counties need to be designated using the MovieTickets.com county number, check movietickets.com from your county #.

Theaters Config Screen:
Image
You can enable or disable theaters by selecting the check box associated with them. Disabled theaters are automatically sorted to the bottom of the list. You can also order the enabled theaters to your preference using the arrows to the right of the list. The navigation can be a little freaky because of the automatic sorting so verify your list before you click Save.

Configure the other plugin options on main config screen to your preference:

InTheaters Folder Path:
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\path" (No trailing \ is needed). The plugin will create a directory called "intheaters" at the specified path.

Extended Searching Options:
If enabled the plugin will try searching other sites for movie info & stills that are not available from the default movietickets.com and movies.com. Individual sites for extended searching can be enabled or disabled.

HQ Coverart Option:
The plugin gets low quality coverart from movietickets.com by default. If enabled, the plugin will do it's best to download high quality coverart from impawards.com. Leave this disabled if you just want the low quality movietickets.com coverart which is guaranteed to be correct when available.

Stills Option:
If enabled the plugin will try to download stills from movies.com. Select the maximum # of stills you want the plugin to download for each movie.

Theaters - Multi Level DB Option:
If enabled the plugin will create a multi level db with theaters & showtimes available for searching\filtering. It will also include a URL to purchase tickets for those theaters and showtimes that have tickets available. Enter the text you wish to be displayed when tickets are available and NOT available in the next two boxes. This can be simple text or an image (ie "skin://buttons/TrailerIsAvail.png")

Trailers Option:
When enabled the plugin will try to find the movies trailer on ITunes for viewing. Select the size of trailer you wish plugin to link to in the drop down box. If the specified size is not available the script will link to the next largest available link unless only a single link is available.

Fuzzy Matching 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.

Enter the text you wish to be displayed when a trailer is available and NOT available in the next two boxes. This can be simple text or an image (ie "skin://buttons/TrailerIsAvail.png")

Post Processing Option: NEW
Enable this option to have the plugin run a "post" processing command when it finishes searching for movies. Format of the command follows the plugin SDK with exception that ":" is replaced by "||": ex. commandgroup||command||parameter(s) where each parameter for the command is separated by || whether you are entering a value for the parameter or not. So to goto the music screen after the completion of the script it would be: xlobby||goto screen||music||

Progress Overlay Option:
The plugin will display an overlay of the refresh progress if Progress Overlay is enabled. Movies.com can be a little tempermental so I personally think its a good idea. Enable "Item based progress overlay" for a 5 line progress with the movie title on a separate line - see the variables below for an explanation. Set the the name of the overlay to use for progress. For example the default overlay in the old script version was: 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>progitem% - Movie name (This variable is enabled in the config screen by enabling "Item based progress overlay")
%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!

Debug Option:
If enabled the script will write extended debugging information (ie all the html source) to the Xlobby\Plugins\intheaters_debug.log. You can leave this disabled, it's really just for me to do debugging.

Timeout Option (next to Debug):
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.

Thats it for the plugin config. Click save and the plugin will save your configuation in the file Xlobby\Plugins\xInTheaters_Settings.xsd. No more having to reset your options every time I release a new version!!!

Plugin Commands:
Only 2 plugin commands are available. Select them just like any other plugin on the F2\Events\Plugins\xInTheaters\Command drop down.
GetMovies
GetMoviesFull

To be honest, I don't think there's a difference right now, at some point GetMovies will be incremental in nature but for now they should both pull a full listing.

Running the plugin:
Create your screens and a refresh button tied to the event above. The plugin will begin spidering for the information on current movies in your area from MovieTickets.com. A "intheaters" directory as specified in the config. Stills and coverart will be downloaded and stored in the folder for their respective movies. The plugin will check to see if the files already exist to reduce bandwidth on subsequent runs. A cleanup routine runs at the end of the plugin to delete folders for movies that are no longer showing. Once the plugin has completed spidering for all movies it will write the output file to Xlobby\databases directory as intheaters.xml. The previous intheaters.xml file in Xlobby\databases will be renamed to intheaters.xml.old if it exists. 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"
xInTheaters 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
The InTheaters database has mutiple levels (ie subitems if enabled) to allow for viewing via theater & showtime categories (see example skin). Variables associated with subitems are:
    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

-------------- End Installation Instructions --------------

Download Plugin
Revisions:
v1.0 06/01/2008 - Initial release.
v1.1 06/05/2008 - Fixed issue for theaters with no showtimes available. Fixed issue if .xml file doesn't exist. Added option for item based progress overlay in the config screen (see progress overlay variables above).
v1.2 7/13/2008 - Update for html changes at MovieTickets.com, Movies.com, and IMDB.com. Added option for extended spidering of Movies.com.
v1.3 7/25/2008 - Update for html changes at Movies.com and impawards.com.
v1.4 9/27/2008 - Update for movietickets.com referrer webrequest.
v1.5 9/28/2008 - Fixed bad regex in showtimes parsing, added error handling for regexlist code.

That’s it for now – let me know if you run into any problems!
Good luck,
tsw
Last edited by tswhite70 on Sun Sep 28, 2008 5:54 pm, edited 9 times in total.
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Re: xInTheaters v1.0 - 06/01/2008

Postby Cabinetguy on Sun Jun 01, 2008 10:56 pm

This is cool!
I'm gonna have to set this up!

Thanks,
Brian
Cabinetguy
 
Posts: 86
Joined: Fri May 02, 2008 9:01 pm
Location: Largo, Florida, USA

Re: xInTheaters v1.0 - 06/01/2008

Postby wesblack on Sun Jun 01, 2008 11:32 pm

Nice work............ !, Thanks for sharing.






Wes Black \ Calrad
wesblack
 
Posts: 852
Joined: Mon Mar 05, 2007 5:02 pm
Location: Valencia, Ca

Re: xInTheaters v1.0 - 06/01/2008

Postby Marbles_00 on Mon Jun 02, 2008 10:24 am

Awesome!!! Have to give it a whirl.
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: xInTheaters v1.0 - 06/01/2008

Postby defrag on Mon Jun 02, 2008 10:31 am

Great work!! Gonna give this a whirl and give you some UK feedback.
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: xInTheaters v1.0 - 06/01/2008

Postby cmhardwick on Mon Jun 02, 2008 3:59 pm

Thanks tsWhite ... I'll have to try this out as well. I LOVED the script. One question (and if it's in the above post, sorry, I just skimmed over it). Are the parameters still customizable? I split a couple of your variables so that the status and movie title could be on seperate lines (helps with odd wrapping on long movies).
cmhardwick
 
Posts: 508
Joined: Fri Jul 14, 2006 6:07 pm
Location: Tennessee

Re: xInTheaters v1.0 - 06/01/2008

Postby Marbles_00 on Mon Jun 02, 2008 5:09 pm

Well, I just got a chance to try it...now admittedly, I most likely have it set wrong, so I'm going over what I have done, but it is crashing when I do a refresh. I first made sure that I deleted the old cache and information from the old script. It found the movie houses within the area (even the local drive-in which is new). The progress overlay opened, and it faultered on the first download. It also only found 9 movies in the area...last time checked, I think there was more of a selection to choose from. Postal code l9b 2m5, just used 15Km/mile radius. I also don't use trailers, but I do have selected HQ cover and 99 stills.

Should I delete the old intheater database and let it build from scratch?

*EDIT*
Okay, I just fooled around with it, and got it to find 24 movies. It got to number 5 and crashed, reporting that "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index."

Funny thing, it crashed on the same movie as before: Forgetting Sarah Marshall. Maybe it has something weird

I also tried with no database (had to build on from scratch), and it crashed indicating it could not find the intheaters.xml file. That was after a restart too.
Last edited by Marbles_00 on Mon Jun 02, 2008 5:42 pm, edited 1 time in total.
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: xInTheaters v1.0 - 06/01/2008

Postby tswhite70 on Mon Jun 02, 2008 5:18 pm

cmhardwick - I forgot you had modified the progress overlay format, in the plugin version you won't be able to do that. Let me think about it and see if I can up with an easy way either add your customization as an option or allow you to change the config via some method.

marbles - When you say crash what do you mean? Error message, just bombs out, Blue Screen?! You might try your postal with a ~ in place of the space also, I can't remeber what I did with the postal parsing code between the plugin and the script if anything at all. I'll run at test tonight with your postal and see what happens. You should not need to delete the database, but it can't hurt.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Re: xInTheaters v1.0 - 06/01/2008

Postby Marbles_00 on Tue Jun 03, 2008 10:22 am

Sorry ts for replying late...went to the gym, watched the Stanley Cup finals...fell asleep before the start of the third overtime...so I didn't get anything done. Basically the progress screen would open up, then it would just hang...nothing was happening. I would have to close xlobby and restart. It seemed to hang on that movie mentioned above. I will try the ~ symbol in the postal code, but funny how in the config screen, without it, it still found the theaters in the area, and at the start of the process the last time I tried it yesterday, it got to the 5th movie (that same damn movie) once and then hung. The one time I didn't have the intheater database, it flagged an error stating that it couldn't find the database, so I restored it back. Another time it only indicated it found 9 movies and faulted on the first one (that movie).
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: xInTheaters v1.0 - 06/01/2008

Postby scottw on Tue Jun 03, 2008 12:30 pm

Sorry to sound dumb but I cant get the trailers to play in Zoom, I am running 4.51wmv. I download quicktime and can play them in the quicktime player but not zoom. I even tried quicktime alternative, is there something I have to set in Zoom???

This is my first crack at this plugin but so far it's great!!!
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xInTheaters v1.0 - 06/01/2008

Postby Marbles_00 on Tue Jun 03, 2008 1:31 pm

Just tried the ~ in the postal code, and did a theater search. But xInTheaters responded with:
"xInTheaters is unable to get theaters for your location from MovieTickets.com. Verify your location information and try again."

So I can either leave just a space in between the postal code or not leave a space. Anything else is not acceptable.

*EDIT*
Well, I found the culprit. It appears that if I have Multi-Level DB checked on, then I get this problem. If I uncheck it (so I'm not using it), I get a clean update, no problems. When checked, the update always halts at Forgetting Sarah Marshall. Also checked tickets.com direct and there is only 9 movies being played at the various houses in my area, so I don't know where 24 came from that one time I attempted an update before.
Marbles_00
 
Posts: 1867
Joined: Wed Apr 06, 2005 12:44 pm
Location: Canada

Re: xInTheaters v1.0 - 06/01/2008

Postby cmhardwick on Tue Jun 03, 2008 3:56 pm

Thanks tswhite. All I did was rather than the parameter being for instance Blood Diamond getting stills, split that to the movie title (so I could put it on one line) and what it was getting (so I could put it on another). That shouldn't be too hard to do in your script, and it does help with long movie titles to them on their own line.
cmhardwick
 
Posts: 508
Joined: Fri Jul 14, 2006 6:07 pm
Location: Tennessee

Re: xInTheaters v1.0 - 06/01/2008

Postby scottw on Tue Jun 03, 2008 4:46 pm

scottw wrote:Sorry to sound dumb but I cant get the trailers to play in Zoom, I am running 4.51wmv. I download quicktime and can play them in the quicktime player but not zoom. I even tried quicktime alternative, is there something I have to set in Zoom???

This is my first crack at this plugin but so far it's great!!!


Nevermind got it working with Media Player Classic. Apparently I have used this before and asked this same question before :oops:

Works great, thanks!!!
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xInTheaters v1.0 - 06/01/2008

Postby tswhite70 on Tue Jun 03, 2008 5:35 pm

Marbles - Yeah, it's a combination error with one of your theaters and the Multi-Level DB code. I wrote a fix last night, but decided I didn't like how I dealt with the issue. Probably take me a few days till I get a chance to get it fixed the way I want. In the meantime you can disable Multi-Level DB as your discovered, or you can disable the Starlight Drive-In in your theaters list (that's the theater thats causing the issue).

I also found the startup issue when no database exists, some code for doing incremental updates that I haven't finished yet and forgot to comment out, I'll get that fixed also.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Re: xInTheaters v1.0 - 06/01/2008

Postby PhilB on Tue Jun 03, 2008 11:53 pm

I am probably doing something wrong. Never used the script. Setup a very basic config and got the error:

"Index was out of range. Must be non-negative and less than the size of the collection"

when trying to execute refresh event.

PB
PhilB
 
Posts: 283
Joined: Sat Feb 18, 2006 6:38 pm

Next