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.

Problems printing a website`s source..

Old posts that have not been replied to for several years.
Locked
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Problems printing a website`s source..

Post by ProXy »

Hi,

I just wrote a little Script that should give out the Source of a given Website to the channel. The sorce of the tcl is:

Code: Select all

proc intern:ogame2 {channel sessionid} {
	set halfurl "http://u3.o5game.de/game/"
	set token [http::geturl [append overviewurl $halfurl "overview.php?session=" $sessionid]]
	putserv "PRIVMSG $channel :$overviewurl"
	upvar #0 $token state
	foreach line [list $state(body)] {
		putserv "PRIVMSG $channel :$line"
	}
	http::cleanup $token
}
The first putserv return the right URL, so I guess that geturl reads the correct site. But why doesn`t the script return the source of the website?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

http://tcl.activestate.com/man/tcl8.3/T ... tp.htm#M29
::http::data $token returns the source =)
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

My guess, is the very first line of the returned data is a NEW LINE character.

This is being sent in the putserv, and causing the server to ignore, or error on the rest of the data.

You don't use the "list" command on the data, as that simply creates a single item list.

You need to split the output, using the newline character "/n"
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

\n

i could be wrong though :roll:
photon?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

you're not :wink:
Elen sila lúmenn' omentielvo
Locked