Go Back   MEPISlovers Forum > How-To's and Scripts > Scripts
Register FAQTop Statistics Today's Posts Donate Gallery
Gallery
Mepis Art Gallery
My images
Upload an image
View all users images
Post New Thread  Reply
Solved - Help with IMDB script please

 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-16-2010, 07:41 AM
voorhees1979 voorhees1979 is offline
MEPIS Guide
 
Join Date: Jul 2009
Location: Suffolk, UK
Gender: Male
Posts: 463
Thanks: 252
Thanked 142 Times in 98 Posts
Rep Power: 26
Reputation: 720
voorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the roughvoorhees1979 is a jewel in the rough
Default Solved - Help with IMDB script please

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 :)
__________________
http://mepislovers.org/forums/image.php?type=sigpic&userid=9213&dateline=1254695  933

Last edited by voorhees1979 : 04-16-2010 at 08:52 AM.
Reply With Quote
The Following User Says Thank You to voorhees1979 For This Useful Post:
Post New Thread  Reply

  MEPISlovers Forum > How-To's and Scripts > Scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script running from an icon ebbing Regulars 27 02-20-2009 06:29 PM
iso2usb.sh script: testers welcome anticapitalista Scripts 4 01-15-2009 07:43 AM
Looking for quick feedback on new Section 9.7 Scripts Jerry3904 MEPIS Documentation 2 12-05-2008 10:56 AM
antiX-upgrader script available for testing anticapitalista AntiX 5 07-25-2008 03:46 AM
Install nvidia from nvidia site script anticapitalista Scripts 2 07-13-2007 04:47 AM


All times are GMT -4. The time now is 10:37 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2010 MEPISlovers.org