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.

help with TCL fetching HTML code and HTTP 302

Help for those learning Tcl or writing their own scripts.
Post Reply
a
alkoleht
Voice
Posts: 6
Joined: Sun Jun 26, 2011 8:12 am

help with TCL fetching HTML code and HTTP 302

Post by alkoleht »

Hi.

I use web based php scripts that my bot reads and processes using simple regexp
It was working perfectly till recently i started running into HTTP 302 code and it broke my script, apparently my webhost did something on theyr side. The script uses procs that generate url, depending on proc used, that is passed to engine that connects and returns the html code to main proc. Then the proc processes the returned html code using simple regexp.

I am still complete noob when it comes to tcl so need help dealing with HTTP 302
Here is my very basic and simple engine that fetches html from URL passed to it:

Code: Select all

proc proc:engine {url} {

	set agent "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"
	set http [::http::config -useragent $agent -urlencoding "utf-8"]
	catch { set http [::http::geturl $url -timeout 50000]} error
	set html [::http::data $http]
	return $html
}
Can anyone help me to fix it please?

Thank you
Post Reply