By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

Programming HTTP communication

P: n/a
I'm usually making my tennis reservations through a Web server
(http://t22-srtm-0171717070.paris.fr/...eb/index.jsp#). The drawback
is that you have to get up early in the morning in order to get your
preferred courts/timeslots...

I would like to have a short program which will:
- Connect to the Web server at a pre-defined time with my identification
data (user/pwd).
- Reserve my favorite tennis court at the preferred time.
- Disconnect from the Web server.

I don't really know what to use for building such "an application".

I looked to WinHttp API from MS Windows. The problem is to know what HTTP
request to make. For example during the identification phase, the Web server
is using Javascript with a form and a submit function. What is then sent as
HTTP commands ?

Is there a program that can "spy" the HTTP command sent by IE ? Would a
simple script program with TELNET commands be sufficient ?

Thanks in advance for your light!
Jul 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jean Pierre MERX wrote:
I would like to have a short program which will:
- Connect to the Web server at a pre-defined time with my identification
data (user/pwd).
- Reserve my favorite tennis court at the preferred time.
- Disconnect from the Web server.
You want a 'bot' and in my opinion they are frowned upon without
consent of the webmaster.
I looked to WinHttp API from MS Windows. The problem is to know what HTTP
request to make. For example during the identification phase, the Web server
is using Javascript with a form and a submit function. What is then sent as
HTTP commands ?
Regardless, learning about this kind of stuff is interesting. Install
Firefox and the LiveHTTPHeaders extension. It will show you all the
data transferring between your computer and the server.

http://www.mozilla.com/
http://livehttpheaders.mozdev.org/installation.html#

Jul 24 '06 #2

P: n/a
Jean Pierre MERX wrote:
I'm usually making my tennis reservations through a Web server
(http://t22-srtm-0171717070.paris.fr/...eb/index.jsp#). The drawback
is that you have to get up early in the morning in order to get your
preferred courts/timeslots...

I would like to have a short program which will:
- Connect to the Web server at a pre-defined time with my identification
data (user/pwd).
- Reserve my favorite tennis court at the preferred time.
- Disconnect from the Web server.
As Bob said, webmasters often don't like this. Sort of the pot calling
the kettle black, if you ask me, since what is having a webserver
besides automation? Program it up properly, though, and they won't be
able to tell the difference.

There are two parts. The second part is to schedule whatever task you
come up with to happen on a regular basis. You can usually do this
from Control Panel in windows (or AT or Schtasks from the command
line), or as a chron job on linux systems.

The first part is the underlying task. I suggest doing this with a
scripting language of your choice. You could accomplish it with
vbscript or php, for example. My recommendation is to actually bring
up an instance of IE (assuming windows) and manipulate it directly, as
if you were using the browser yourself:

(starter vbscript code):
Set ie = CreateObject("InternetExplorer.Application")
ie.visible = true;
ie.Navigate2 "TennisSite.com"
While ie.ReadyState<>4: WScript.Sleep 10: Wend
'Start filling out form here:
ie.document.getElementById("userName") = "JeanPierre"
ie.document.getElementById("password") = "tennisFanatic"
ie.document.forms[1].submit
'... wait for next page
'determine court preference, etc.
If you've never done this before, you'll have some [a lot of] learning
to do. But in the end, you'll get to sleep in.

Csaba Gabor from Vienna

Jul 25 '06 #3

P: n/a
There are two parts. The second part is to schedule whatever task you
come up with to happen on a regular basis. You can usually do this
from Control Panel in windows (or AT or Schtasks from the command
line), or as a chron job on linux systems.

The first part is the underlying task. I suggest doing this with a
scripting language of your choice. You could accomplish it with
vbscript or php, for example. My recommendation is to actually bring
up an instance of IE (assuming windows) and manipulate it directly, as
if you were using the browser yourself:
I favor php as a personal preference. You can simulate a user's
browsing session using CURL (http://us2.php.net/manual/en/ref.curl.php)
though the initial setup may be more difficult. Then again if it was me
I'd use the socket functions
(http://us2.php.net/manual/en/ref.sockets.php).

Jul 25 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.