how to send referer and url to txtfile using sed

Ask for help about FlashGot, no registration needed to post
Post Reply
AngraMainyu768

how to send referer and url to txtfile using sed

Post by AngraMainyu768 »

So i got to make send to textfile work. however it only contains links, i also need the referer.
so how do do that with sed?(linux stream editor)

I made a new topic because i believe this has little relation to my previously started topic.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Linux Mint/9 (Isadora) Firefox/3.6.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: how to send referer and url to txtfile using sed

Post by Giorgio Maone »

Use a custom support definition like this

Executable:

Code: Select all

/bin/sh
Command line template:

Code: Select all

/path/to/my/script.sh [REFERER] [UFILE]
Where script.sh is something like

Code: Select all

#!/bin/sh
REFERER="$1"
URL_FILE="$2"
# ... processing goes here
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
AngraMainyu768

Re: how to send referer and url to txtfile using sed

Post by AngraMainyu768 »

Giorgio Maone wrote:

Code: Select all

#!/bin/sh
REFERER="$1"
URL_FILE="$2"
# ... processing goes here
I've got what i've got to do but i don't understand the "#processing goes here" part.
what exactly do i put in there? i don't know much about scripting.
although the thing i want to do is make the script output a txt file that contains

Code: Select all

http://www.example.com/referer.html
http://www.example.com/file.file
or

Code: Select all

referer
http://www.example.com/referer.html
urls
http://www.example.com/file1.file
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Linux Mint/9 (Isadora) Firefox/3.6.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: how to send referer and url to txtfile using sed

Post by Giorgio Maone »

Sorry, I did not notice you where on Windows.

Just use

Executable:

Code: Select all

C:\Windows\System32\cmd.exe
Command line template:

Code: Select all

/C ( echo referer & echo [REFERER] & echo urls & type [UFILE] ) > C:\FlashGot.txt & notepad C:\FlashGot.txt
(omit the trailing "& notepad C:\FlashGot.txt" if you don't want the file to be opened automatically.)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
AngraMainyu768

Re: how to send referer and url to txtfile using sed

Post by AngraMainyu768 »

Giorgio Maone wrote:Sorry, I did not notice you where on Windows.
Uh, actually I'm on lxde mint 9. though i dual boot xp but only for windows-only games.
so again, kindly explain what should i do here

Code: Select all

#!/bin/sh
REFERER="$1"
URL_FILE="$2"
# ... processing goes here<<<---this part, or rather, what should be written below this
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Linux Mint/9 (Isadora) Firefox/3.6.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: how to send referer and url to txtfile using sed

Post by Giorgio Maone »

AngraMainyu768 wrote:
Giorgio Maone wrote:Sorry, I did not notice you where on Windows.
Uh, actually I'm on lxde mint 9. though i dual boot xp but only for windows-only games.
so again, kindly explain what should i do here

Code: Select all

#!/bin/sh
REFERER="$1"
URL_FILE="$2"

# the file you want your output to go into
OUT="$HOME/flashgot-list.txt"
# writes out the file
( echo "referer" && echo "$REFERER" && echo "urls" && cat "$URL_FILE" ) > "$OUT"
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
AngraMainyu768

Re: how to send referer and url to txtfile using sed

Post by AngraMainyu768 »

Giorgio Maone wrote:
AngraMainyu768 wrote:
Giorgio Maone wrote:Sorry, I did not notice you where on Windows.
Uh, actually I'm on lxde mint 9. though i dual boot xp but only for windows-only games.
so again, kindly explain what should i do here

Code: Select all

#!/bin/sh
REFERER="$1"
URL_FILE="$2"

# the file you want your output to go into
OUT="$HOME/flashgot-list.txt"
# writes out the file
( echo "referer" && echo "$REFERER" && echo "urls" && cat "$URL_FILE" ) > "$OUT"
PERFECT! It works! thanks a lot!
by the way. why is this feature(outputting urls, referers and whatnot to a txt file) not included in flashgot by default? seems pretty useful to me.
I'm not requesting it to be included though(after all, this is the support section). i was just wondering why it isn't there out of the box.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100628 Linux Mint/9 (Isadora) Firefox/3.6.6
Post Reply