Hey all
I am trying to get this working on antiX/Gnome. Its a script I found that allows you to right click movie.avi and it loads up IMDB in selected browser for info. But what I want it to do is also work for folder names, I can't for the life of me figure this out. The script is here, no idea where I found it.
Code:
#!/bin/bash
# defines
MOVIE_URI='http://www.imdb.com/find?s=all&q=MOVIE&x=0&y=0'
MOVIE_BROWSER='epiphany-browser'
MOVIE_SEPCHAR='+'
# Open MOVIE_BROWSER with MOVIE_URI
##########################################################################
# Nautilus "IMDB" Script #
##########################################################################
# #
# Created by Michal Horejsek.com (pxjava) #
# Email: horejsekmichal@gmail.com #
# Version: 1.1 / 26.7.2009 15:20:54 #
# #
##########################################################################
MOVIE=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS} # get selected file paths
MOVIE=${MOVIE##*/} # remove path (/home/user/../)
MOVIE=${MOVIE%.*} # remove type (.avi, .mkv)
MOVIE=${MOVIE// /.} # replace space (" ") to dot (".")
MOVIE=`echo $MOVIE | tr '[:upper:]' '[:lower:]'` # to lowercase
MOVIE=`echo $MOVIE | tr '\.\-\_' $MOVIE_SEPCHAR` # replace .-_ to separate character
MOVIE=`expr "$MOVIE" : '\([^\[\(]*\)'` # remove brackets
if [ "`expr "$MOVIE" : '\(.*\)[0-9][0-9][0-9][0-9]'`" != "" ]; then
MOVIE=`expr "$MOVIE" : '\(.*\)[0-9][0-9][0-9][0-9]'` # remove year
fi
MOVIE_URI=${MOVIE_URI/MOVIE/$MOVIE} # create URI
`$MOVIE_BROWSER $MOVIE_URI` # execute command
If I right click a .avi it works 100% if I right click a folder name (which is a movie name as well) imdb just loads up blank. Any ideas would be great. I have a feeling its todo with the remove path section.
Thanks
EDIT: I changed MOVIE=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS} # get selected file paths to MOVIE=$1
Seems to have fixed it :)