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.

How to read from a remote txt file via http?

Old posts that have not been replied to for several years.
Locked
K
KokoRyu

How to read from a remote txt file via http?

Post by KokoRyu »

Hey,

I've made a web script that generates a single line text file containing data posted on a webform.

I need to write a tcl that checks say every 10 seconds or so that will read that text file via a http:// call and then set the content to a variable to be used inside the script.

The eggdrop and the web server are un LAN'd seperate boxes.

Can anyone help?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

For an 10 minutes *timer* use something like:

Code: Select all

bind time - "?0 *" my:time
as for the web thing (requires http package):

Code: Select all

package require http
set token [::http::geturl "your_url_goes_here"]
set content [::http::data $token]
::http::cleanup $content
and get your stuff from $content.
Once the game is over, the king and the pawn go back in the same box.
Locked