How to get sandwiches on the Internet

One of our neighbors wanted to take orders online, so we hooked up their menu to post to, and then made a web page that “displayed” the orders.

The idea involved a Windows scheduled task, running on their personal computer, next to the kitchen, that would poll a web page for orders.

When new ones showed up, it would print them, and so long as the print succeeded, it would mark the orders as printed. The client code looked like this:

On Error Resume Next
Set IE = WScript.CreateObject("InternetExplorer.Application")
while IE.busy = True: WScript.Sleep 100: wend
If InStr(IE.Document.Body.innerHTML, "<!-- ok -->") &gt; 0 Then
	IE.ExecWB 6,2,2,0
	while IE.busy = True: WScript.Sleep 100: wend
	If Err.Number = 0 Then
		while IE.busy = True: WScript.Sleep 100: wend
	End If
End If

Meanwhile, the server code was a (longer, and less interesting) perl script which simply formatted the page printably (using <table> tags and everything) and had a form on it with (hidden) checkboxes. The page included an <!– ok –> right at the end to signal completedness.

Leave a Reply