| View previous topic :: View next topic |
| Author |
Message |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 3:04 am Post subject: Copy Data From Web To IRC using Eggdrop |
|
|
Can Help me ...
Example visit this site http://vampire.utopianz.net/
see the server status...
i just want take that server status to mirc.. how? |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Mar 09, 2008 1:08 pm Post subject: Re: Copy Data From Web To IRC using Eggdrop |
|
|
| PisangGoreng wrote: | Can Help me ...
Example visit this site http://vampire.utopianz.net/
see the server status...
i just want take that server status to mirc.. how? | I seriously doubt anyone here will help you with mIRC, there is a forum for that program. |
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 8:07 pm Post subject: |
|
|
| can you tell me what name of that program(copy data from web to IRC using eggdrop) |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 8:24 pm Post subject: |
|
|
| 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. |
|
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 8:28 pm Post subject: |
|
|
| can you give TCL that related to that |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 8:40 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 8:53 pm Post subject: |
|
|
| I DONT know what to pick.. can you suggest me.. ? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 9:08 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 9:26 pm Post subject: |
|
|
| Code: | # 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 |
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 9:27 pm Post subject: |
|
|
i'm just new in tCL what mean ?
| Quote: | # requires tcllib http package
package require http |
|
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 9:35 pm Post subject: |
|
|
it said that
| Quote: | [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
|
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 9:45 pm Post subject: |
|
|
| PisangGoreng wrote: | it said that
| Quote: | [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).. | Quote: | <selhceeps> !info
<sp33chy> Login server : Online, Char Server : Online, Maps Server : Online
<sp33chy> Current Connections : 2, User(s) Online : 16 |
|
|
| Back to top |
|
 |
PisangGoreng Voice
Joined: 10 Dec 2007 Posts: 35 Location: Malaysia
|
Posted: Sun Mar 09, 2008 9:50 pm Post subject: |
|
|
erm...
please help me.. u use own shell or you buy other ppl shell ? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 09, 2008 9:52 pm Post subject: |
|
|
| PisangGoreng wrote: | erm...
please help me.. u use own shell or you buy other ppl shell ? |
it works on either the shells I use or my windrop, I don't understand what your doing wrong.. Use an up-to-date current eggdrop and tcl 8.4. |
|
| Back to top |
|
 |
|