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.

[n00b] - [http::geturl $query]

Old posts that have not been replied to for several years.
Locked
M
MaNDaRK

[n00b] - [http::geturl $query]

Post by MaNDaRK »

Hello,

I want to get the data from a file on a webserver, and the data must been shown in the channel with a trigger

Example:
Tigger: !post
Shows the data of: http://test.server.nl/test.php
(The data contains more then one line)

Can you help me with that? ty! :)

(I tried this:

Code: Select all

package require http

bind pub - !post pub:post


post pub:post { nick uhost handle channel arg } {
		set query ["http://test.server.nl/test.php"]
		set token [http::geturl $query]
		upvar #0 $token state
		putserv "PRIVMSG $channel :$token"
	}
putlog "*** WebGet Script loaded ***"
)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Since it's more than 1 line, you have to use multiple putservs. You can only send 1 line per privmsg, right? So use 'split' to turn the data into a list. Then use a loop to output each line with putserv.
Locked