[RESOLVED] Sending URL Variable to Bash Script by FlashGot

General discussion about the FlashGot extension for Firefox
Post Reply
jayjaygibbs
Posts: 4
Joined: Thu Nov 12, 2009 8:47 pm

[RESOLVED] Sending URL Variable to Bash Script by FlashGot

Post by jayjaygibbs »

I'm trying to run a simple script from Firefox using Flashgot:

Code: Select all


#! /bin/bash
sp-sc $1 8908 8909 & 
#TRYING TO SET $1 as URL Variable
sleep 5 && vlc http://localhost:8909

I am aware that there are better ways of starting sp-sc but once I can suss this out it will lead to some more useful things for me.

I set Flashgot to run my simple script but I can't seem to find a way to set the url link to a variable e.g $1

Any help, or comments, would be really appreciated.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091106 Shiretoko/3.5.5
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Trying to parse URL variable to Bash Script using Flashgot

Post by Giorgio Maone »

You should setup a custom download manager entry with executable /bin/bash and arguments template:

Code: Select all

/path/to/my/script.sh [URL]
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
jayjaygibbs
Posts: 4
Joined: Thu Nov 12, 2009 8:47 pm

Re: Trying to parse URL variable to Bash Script using Flashgot

Post by jayjaygibbs »

Thanks for your post but I'm not sure I understand what you mean.

I'm trying to set the [URL] to a variable that I can use in my script.

What is the variable of [URL] if I set the download manager like you say?
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091106 Shiretoko/3.5.5
jayjaygibbs
Posts: 4
Joined: Thu Nov 12, 2009 8:47 pm

Re: Trying to parse URL variable to Bash Script using Flashgot

Post by jayjaygibbs »

SORRY!!! I got it. Thanks a lot. I didn't put the $1 variable in single quotes.

Code: Select all

sp-sc '$1' 8908 8909 & 
It should have been this.

Thank you soooooo much. This is really useful!!
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091106 Shiretoko/3.5.5
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: [RESOLVED] Sending URL Variable to Bash Script by FlashGot

Post by therube »

(Since I didn't know what SopCast was ... is a simple, free way to broadcast video and audio or watch the video and listen to radio on the Internet.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6pre) Gecko/20091114 SeaMonkey/2.0.1pre
Post Reply