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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
FARAGames
Posts: 11
Joined: 04 Aug 2013 22:03

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

#1 Post by FARAGames » 06 May 2014 22:44

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.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

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

#2 Post by penpen » 07 May 2014 03:42

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

miskox
Posts: 656
Joined: 28 Jun 2010 03:46

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

#3 Post by miskox » 07 May 2014 04:17

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

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

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

#4 Post by Squashman » 07 May 2014 11:35

Do you need me to merge this with your other thread?
viewtopic.php?f=3&t=5188

Post Reply