egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help with TCL fetching HTML code and HTTP 302

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
alkoleht
Voice


Joined: 26 Jun 2011
Posts: 6

PostPosted: Sat Feb 07, 2015 3:10 pm    Post subject: help with TCL fetching HTML code and HTTP 302 Reply with quote

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:

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber