This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

What exactly does this mean????

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

What exactly does this mean????

Post by droolin »

I have a line of code that I borrowed from another script to read the 7.html page from shoutcast.

Code: Select all

 puts -nonewline $lcl_StreamWebPageScoket "GET /7.html HTTP/1.1\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-sh
ockwave-flash, */*\nAccept-Language: en-us\nAccept-Encoding: gzip, deflate\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; T312461; (R1 1.3); .NE
T CLR 1.0.3705; .NET CLR 1.1.4322)\nHost: www.awesomechat.net\nConnection: Keep-Alive\n\n"
But I have no idea what it means other then it puts a line as if it was a browser???? But, the rest of that stuff???? I have no idea.

Can anyone explain to me why this would be done like this?

Dan
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Thats the older method using the tcl socket code to retrieve webpages manually. Obviously the person who wrote the original script knew exactly what they needed to access a particular webpage in this way..Most(?) of us nowdays use the tcl http package, because it simplifies things a bit especially with more complicated web pages requiring queries and such.

The Accept- lines are http header directives. Refer to the relevant htt-protocol specs, eg:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Post Reply