Gossamer Forum
Home : General : Internet Technologies :

wget - output file?

Quote Reply
wget - output file?
Hi guys. I've been having a look through the docs, and also on Google; but can't seem to find an answer.

Is it possible to do something like;

wget http://www.mysite.com/index.php?get=test&group=1234 > import.txt

... where the output from that page is text.

I've done a similar thing already with LWP::Simple... but its slow as hell.. so I'm trying to work out another way :/

Code:
print "Grabbing URL: $_ \n" if $DEBUG;
my @got = get($link);


print "Grabbed URL: $link , now writing...\n" if $DEBUG;
open (XMLTEST, ">$CFG->{admin_root_path}/dev/$id.xml") || die "Can't write file $CFG->{admin_root_path}/dev/$id.xml. Reason: $!";
print XMLTEST @got;
close(XMLTEST);

Anyone got any suggestions? Smile

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] wget - output file? In reply to
BTW..I've tried;

Code:
u35559069: > wget http://domain.com/pf/pf?a=322582&unlimited=true&&programs=5488&format=xml&zip=false -O=test.xml
[1] 11075
--12:08:19-- http://domain.com/pf/pf?a=322582
=> `pf?a=322582'
Resolving domain.com... [2] 11076
[3] 11077
done.
Connecting to domain.com[217.212.240.174]:80... bash: -O=test.xml: command not found
[2]- Done unlimited=true && programs=5488
[3]+ Done format=xml
u35559069: > connected.
HTTP request sent, awaiting response...
…dies ends here

... and as you can see, it just tried to grab each ? ... etc one seperatly (i.e format=xml, unlimited=true, etc).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] wget - output file? In reply to
wget -o filename.txt 'http://www.mysite.com/index.php?get=test&group=1234'

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] wget - output file? In reply to
OMG.. that simple?

Thanks Alex.. I'll give it a go now :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] wget - output file? In reply to
Finally worked out why its not working <G>

Code:
wget -o filename.txt 'http://www.mysite.com/index.php?get=test&group=1234'

..should be;

Code:
wget -Ofilename.txt 'http://www.mysite.com/index.php?get=test&group=1234'

..i.e a capital "O", and no space.

Just thought I would post the answer, in case anyone stumbles across this thread at some point, and the solution doesn't work for you :D

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!