Skip to content

Instantly share code, notes, and snippets.

@chanian
Created June 16, 2011 18:52
Show Gist options
  • Save chanian/1029949 to your computer and use it in GitHub Desktop.
Save chanian/1029949 to your computer and use it in GitHub Desktop.
Was that movie originally filmed in IMAX? Or am I paying extra for good marketing...
#!/bin/sh
#
# usage: ./imax.sh "tron 2"
#
# Note, this doesn't always work as it is clearly scrapping imdb.
# comment below for any suggested changes!
#
echo "Was it filmed in IMAX?"
q=`echo $1 | sed -e s/\ /\+/g`
# find the title of the movie
echo `curl --silent "http://www.imdb.com/find?s=tt&q=${q}" | grep -m1 "<a href=\"/title"` | cut -d ">" -f4 | cut -d "<" -f1
# get the path to the technical notes
imdb_path=`curl --silent "http://www.imdb.com/find?s=tt&q=${q}" | grep -m1 "<a href=\"/title" | cut -d "=" -f3 | cut -d " " -f1`
imdb_path=`echo $imdb_path | sed -e s/\"//g`
echo "http://www.imdb.com${imdb_path}technical"
# parse out the conditions from the technical notes
details=`curl --silent "http://www.imdb.com${imdb_path}technical"`
is_digital_3d=`echo $details | grep -c -i "IMAX Digital 3-D"`
imax_mentioned=`echo $details | grep -c -i "imax"`
is_65mm=`echo $details | grep -c -i "65 mm"`
is_dmr=`echo $details | grep -c -i "DMR"`
some_scenes=`echo $details | grep -c -i "some scenes"`
# and then print out the permutations of "IMAX"
if [ $is_digital_3d != 0 ]
then
echo "YES, IMAX Digital 3D"
elif [ $is_65mm != '0' ] && [ $imax_mentioned != 0 ]
then
if [ $some_scenes != 0 ]
then
echo "YES, some scenes were filmed in IMAX 65mm"
else
echo "YES, this was filmed in IMAX 65mm"
fi
elif [ $is_dmr != '0' ]
then
echo "NO, however it was blown up to 70mm using DMR"
else
echo "NO"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment