PisangGoreng wrote:can you tell me what name of that program(copy data from web to IRC using eggdrop)
it's called scripting, except on mIRC it's using mirc syntax.. eggdrop uses tcl syntax. Neither is easily ported to the other, so making such requests is usually frowned upon.
There are a myriad of scripts here that can 'web to irc' as you put it. Any script that pulls data from a website to reformat for display onto irc can do this.
A computer would respond to your question like this...it wrote:Too many results to display. Please refine your search.
http://www.egghelp.org/tclhtml/3478-4-0-0-1-web.htm - click that url for starters
Asking for a wheel when a wheel has already been provided (the irony of my comments will certainly be lost) usually gets met with , but what I mean is, what your asking is more than likely already realized and found in the archive.
PisangGoreng wrote:I DONT know what to pick.. can you suggest me.. ?
The web is a very very large pond, to pull something good from it requires proper bait.. What is the url of the website you wish relevant information pulled from?
# requires tcllib http package
package require http
# chanset flag
setudef flag serverinfo
# query/timeout can be adjusted here.
variable serverquery "http://sonic.utopianz.net/vampirero/"
variable servertimeout 10
bind pub - "!info" checkserver
proc checkserver {nick host hand chan rest} {
# chanset catch, use .chanset #yourchan +serverinfo to enable
if {[lsearch -exact [channel info $chan] +serverinfo] == -1} { return 0 }
# browser agent
set http [::http::config -useragent "Mozilla"]
# get url with error control
catch {set http [::http::geturl "$::serverquery" -timeout [expr 1000 * $::servertimeout]]} error
# case 1, no socket
if {[string match -nocase "*couldn't open socket*" $error]} {
putserv "privmsg $chan : Cannot open socket. Try again later."
::http::cleanup $http
return 0
}
# case 2, timeout
if { [::http::status $http] == "timeout" } {
putserv "privmsg $chan : Website has timed out. Try again later."
::http::cleanup $http
return 0
}
# case 3, success, get html
set html [::http::data $http]
# scrape the page
if {![regexp -- {Login Server : <.*?>(.+?)<} $html - s_login]} {set s_login Unknown}
if {![regexp -- {Char Server : <.*?>(.+?)<} $html - s_char]} {set s_char Unknown}
if {![regexp -- {Map Server : <.*?>(.+?)<} $html - s_maps]} {set s_maps Unknown}
if {![regexp -- {Current Connections : <.*?>(.+?)<} $html - s_connect]} {set s_connect Unknown}
if {![regexp -- {User\(s\) Online : <.*?>(.+?)<} $html - s_users]} {set s_users Unknown}
# reformat scraped information and message to irc.
puthelp "privmsg $chan :Login server : $s_login, Char Server : $s_char, Maps Server : $s_maps"
puthelp "privmsg $chan :Current Connections : $s_connect, User(s) Online : $s_users"
return 1
}
EDit: (in reply to post below) ... http package is part of tcllib and normally a standard part of eggdrop. It's purpose in the script is to alert eggdrop that http package is a required dependency, nothing more...
EDit2: corrected code above to use a chanset method of channel selection.
Last edited by speechles on Sun Mar 09, 2008 11:17 pm, edited 9 times in total.
[01:33] wrong # args: should be "proc name args body"
while executing
"proc checkserver {nick host hand chan rest} {
# browser agent
set http [::http::config -useragent "Mozilla"]
# get url with error co..."
(file "scripts/serverchecker.tcl" line 11)
invoked from within
[01:33] wrong # args: should be "proc name args body"
while executing
"proc checkserver {nick host hand chan rest} {
# browser agent
set http [::http::config -useragent "Mozilla"]
# get url with error co..."
(file "scripts/serverchecker.tcl" line 11)
invoked from within
Very, very strange indeed. Because for me it said this (I didn't test beforehand, but my own tests after prove it's just fine)..
<selhceeps> !info
<sp33chy> Login server : Online, Char Server : Online, Maps Server : Online
<sp33chy> Current Connections : 2, User(s) Online : 16