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.

Copy Data From Web To IRC using Eggdrop

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Copy Data From Web To IRC using Eggdrop

Post by PisangGoreng »

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?
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Re: Copy Data From Web To IRC using Eggdrop

Post by DragnLord »

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.
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

can you tell me what name of that program(copy data from web to IRC using eggdrop)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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.
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

can you give TCL that related to that
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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 :roll:, but what I mean is, what your asking is more than likely already realized and found in the archive.
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

I DONT know what to pick.. can you suggest me.. ?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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?
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

how bout this site http://www.pisangx.com/online.html
just wanna take all of that..
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

# 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.
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

i'm just new in tCL what mean ?
# requires tcllib http package
package require http
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

it said that
[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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

PisangGoreng wrote:it said that
[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
P
PisangGoreng
Voice
Posts: 35
Joined: Mon Dec 10, 2007 9:19 am
Location: Malaysia
Contact:

Post by PisangGoreng »

erm...
:cry: :cry: :cry: :cry:
please help me.. u use own shell or you buy other ppl shell ?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

PisangGoreng wrote:erm...
:cry: :cry: :cry: :cry:
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.
Post Reply