egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy Data From Web To IRC using Eggdrop
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 3:04 am    Post subject: Copy Data From Web To IRC using Eggdrop Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Mar 09, 2008 1:08 pm    Post subject: Re: Copy Data From Web To IRC using Eggdrop Reply with quote

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
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 8:07 pm    Post subject: Reply with quote

can you tell me what name of that program(copy data from web to IRC using eggdrop)
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 8:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 8:28 pm    Post subject: Reply with quote

can you give TCL that related to that
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 8:40 pm    Post subject: Reply with quote

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 Rolling Eyes, but what I mean is, what your asking is more than likely already realized and found in the archive.
Back to top
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 8:53 pm    Post subject: Reply with quote

I DONT know what to pick.. can you suggest me.. ?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 9:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 9:11 pm    Post subject: Reply with quote

how bout this site http://www.pisangx.com/online.html
just wanna take all of that..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 9:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 9:27 pm    Post subject: Reply with quote

i'm just new in tCL what mean ?

Quote:
# requires tcllib http package
package require http
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 9:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 9:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
PisangGoreng
Voice


Joined: 10 Dec 2007
Posts: 35
Location: Malaysia

PostPosted: Sun Mar 09, 2008 9:50 pm    Post subject: Reply with quote

erm...
Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad
please help me.. u use own shell or you buy other ppl shell ?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 09, 2008 9:52 pm    Post subject: Reply with quote

PisangGoreng wrote:
erm...
Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber