Page 1 of 1

Creating a small batch program

Posted: 20 Oct 2018 16:39
by hacxx
Step by step
1) make a get url request using curl
2) save the content of the url in a string/variable
3) extract a few elements from the string/variable

4) Make a post url request with some of the elements in the string/variable
[The elements required are cookies, headers and token]

5) Save the result from post request
6) Locate using Find or something similar to find some elements
7) Make a get request to the elements extracted from Find
8) Print the texts in the console (cmd)
9) Print Using a image program to show the image extracted in console (cmd)

This steps are only theorial can this be done in batch?

Re: Creating a small batch program

Posted: 20 Oct 2018 17:37
by Squashman
What is stopping you from attempting to code this?

Re: Creating a small batch program

Posted: 20 Oct 2018 17:57
by hacxx
Converting the get request to a string/variable. I don't how to do in cmd

Extract the token, cookie and header from string/variable

Make a POST request and extract the text and the image

Free program to embed images in cmd

Re: Creating a small batch program

Posted: 20 Oct 2018 18:53
by ShadowThief
The GET request is already a string; or are you trying to store the response in a string? Because that's just

Code: Select all

for /f "delims=" %%A in ('curl [request]') do set "get_response=%%A"
where you replace [request] with whatever the request is. You could also use curl's -o option to store the output in a file.
POST requests can be processed the same way.

Extracting values from the responses will vary based on the response string, but it's also going to be a for /f loop.

I'm not aware of anything that can embed images in the command prompt, and I'm really not sure why you would want this in the first place.

Re: Creating a small batch program

Posted: 11 Nov 2018 14:55
by hacxx
Thanks that really helped