Page 1 of 1

how to send referer and url to txtfile using sed

Posted: Tue Jul 06, 2010 12:14 pm
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.

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

Posted: Tue Jul 06, 2010 12:33 pm
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

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

Posted: Tue Jul 06, 2010 3:35 pm
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

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

Posted: Tue Jul 06, 2010 4:49 pm
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.)

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

Posted: Wed Jul 07, 2010 3:27 am
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

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

Posted: Wed Jul 07, 2010 10:20 am
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"

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

Posted: Wed Jul 07, 2010 10:38 am
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.