Page 1 of 1

Way to read text on a site and put it in batch?

Posted: 06 May 2014 22:44
by FARAGames
I'm trying to make a simple chat system with an FTP server in batch. (this will soon turn into textcraft online) and I am having a lot of trouble. Basically, for some reason, this website reads out the batch file, when you click on it, instead of downloading it like I want it to (so I can use wget) does anyone know if there is a program that can read out what is on a website and put it into a batch file. like wget, except it reads rather than downloads.

Re: Way to read text on a site and put it in batch?

Posted: 07 May 2014 03:42
by penpen
I'm not sure if i do understand your problem, i could imagine 2 issues you may have:
1) You have a hyperlink to a batch file in (one or more) webpage(s) of your website and everytime you click on this link it loads the batch file into the browser.
Instead you want to download it.
(In this case i don't know what this has to do with wget!?)

Solution: Just right click the hyperlink and choose "Save target as" (or similar basing on your browser).

or 2) You are using wget to download the batch file, and the content of the downloaded file is displayed to the dos shell screen.

Solution: Just use the save output option (-O, or --output-document=) of wget and specify a download location:

Code: Select all

:: displays file content
wget -q -O- http://google.com

:: stores file content to index.hmtl
wget -q -O"index.html" http://google.com

:: stores file content to index2.hmtl
wget -q --output-document="index2.html" http://google.com

(In this case i don't know why the website reads out your batch file, and you said "i can use wget"!?)

penpen

Re: Way to read text on a site and put it in batch?

Posted: 07 May 2014 04:17
by miskox
Looks like we don't really understand what you want. Maybe you can try with these WGET switches:

Code: Select all

       --post-data=STRING      use the POST method; send STRING as the data.
       --post-file=FILE        use the POST method; send contents of FILE.
       --content-disposition   honor the Content-Disposition header when
                               choosing local file names (EXPERIMENTAL).


Saso

Re: Way to read text on a site and put it in batch?

Posted: 07 May 2014 11:35
by Squashman
Do you need me to merge this with your other thread?
viewtopic.php?f=3&t=5188