[ Team LiB ] Previous Section Next Section

Hack 23 Get Movie Showtimes

figs/beginner.giffigs/hack23.gif

You can use Amazon to plan your evening by finding out when, where, and what movies are playing in your local theaters.

It's Saturday afternoon—time to make plans for the evening. Of course the Web holds all the information you need to figure out what to do. Surprisingly, though, Amazon.com is among the sites that can help you out. One of the lesser-known features Amazon provides is movie showtimes. Figure 2-11 shows the home page of the Movies category (http://www.amazon.com/movies). When you provide Amazon with your zip code, you'll see a list of the theaters in your area along with movies and times they're playing.

Figure 2-11. Amazon movie showtimes
figs/amzh_0211.gif

The zip code form is an interface for creating a URL that gets the information you want. Typing your zip code and clicking Submit creates a URL like this:

http://www.amazon.com/exec/obidos/search-handle-url/?index=showtimes[RETURN]
&field-power=zips5:insert zip code&field-date=insert date&item-start=1[RETURN]
&item-end=10

If you want to tweak the results page so that it displays more than one zip code, it's possible to examine the URL and change some values. The first relevant value is field-power. You can set this to a two-part value that's formatted like this:

zipsinsert mile radius:insert zip code

For example, if you want to find movies playing within five miles of Sebastopol, CA, you could set the field like this:

zips5:95472

The next value you need to set is field-date. It has a straightforward format that includes the year, month, and day: yyyymmdd. So if you want to know the movies playing on July 4, 2003, you would set field-date to 20030704.

However, Amazon stores movie times for only seven days beyond the current date, so you can't research the past or predict the distant future.

Now that you know the syntax, you can begin to modify it a bit. Amazon's interface doesn't let you choose multiple zip codes, but you can list movies in several areas by tweaking the URL. Say you wanted to know movies playing within five miles in both Sebastopol, CA and Corvallis, OR. Just set several values in field-power with "or":

zips5:95472 or zips5:97330

The value has to be URL-encoded [Hack #92] by converting the spaces to %20; once that's done, you can make the full request. Be sure to set the date to the current day, or a few days in the future.

http://www.amazon.com/exec/obidos/search-handle-url/?index=showtimes[RETURN]
&field-power=zips5:95472%20or%20zips5:97330&field-date=20030704[RETURN]
&item-start=1&item-end=10

In addition to viewing times on the Web, you can receive local showtimes via email. Visit http://www.amazon.com/movies-email to subscribe.

    [ Team LiB ] Previous Section Next Section