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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Sat Jun 30, 2007 5:20 am
hello.
i was wondering if u can make me simple script that checks if site is online but it would say it when u come on channel like...
[11:08:40] * Now talking in #egghelp.org
[11:08:40] * Topic is 'bla bla bla'
[11:08:41] -bot- Welcome! the site
www.egghelp.org is
ONLINE !
and if the site is not online
[11:08:40] * Now talking in #egghelp.org
[11:08:40] * Topic is 'bla bla bla'
[11:08:41] -bot- Welcome! the site
www.egghelp.org is
OFFLINE !
tnx
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Sun Jul 01, 2007 9:28 am
i see no one replayed so this is hard?
you cant do it?
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Sun Jul 01, 2007 11:23 am
Snorly wrote: i see no one replayed so this is hard?
you cant do it?
This has nothing to do with being "hard", nor with being able to do it.
My guess is that no one
wants to do it.
This is a "request" forum, no one is obligated to make requests, I suggest a lot more patience.
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Mon Jul 02, 2007 8:31 am
oh i see
tnx anyway
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Mon Jul 02, 2007 10:41 am
What's the website you will check status on/off ?
|AmDeAtH @ Undernet
Death is only the *Beginning*...
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Tue Jul 03, 2007 3:11 pm
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Tue Jul 03, 2007 6:17 pm
It's not in English so atleast I can't help I am sorry.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Wed Jul 04, 2007 8:33 am
u can make it in English and i will edit it.
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Wed Jul 04, 2007 9:22 am
iamdeath wrote: It's not in English so atleast I can't help I am sorry.
Snorly wrote: u can make it in English and i will edit it.
I believe iamdeath meant the websites.
speechles
Revered One
Posts: 1398 Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)
Post
by speechles » Wed Jul 04, 2007 12:51 pm
Code: Select all
package require http
set query "http://www.filelist.org"
set ua "Lynx"
set http [::http::config -useragent $ua]
catch {set http [::http::geturl "$query" -timeout [expr 1000 * 5]]} error
if {$error != "" } {
putserv "NOTICE $nick :Welcome! the site ${query} is OFFLINE!"
} else {
putserv "NOTICE $nick :Welcome! the site ${query} is ONLINE!"
}
I'm assuming that your request meant to only check if the site was loadable, not to actually scrape anything from it. The above snippet will accomplish it. Someone else can turn this into a full script for you if they care to, or you yourself can with basic tcl knowledge.
Snorly
Voice
Posts: 25 Joined: Mon Apr 17, 2006 2:44 pm
Post
by Snorly » Wed Jul 04, 2007 1:06 pm
yes thats it
can u add that i set a channel i dont want to greet with this on all channels
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Wed Jul 04, 2007 2:00 pm
Just because an error is returned doesn't mean its offline, speechles should of checked the error.
Maybe something like below:
Code: Select all
package require http
bind join -|- {*} greet:join
proc greet:join {nick uhost hand chan} {
if {[string equal -nocase #mychannel $chan]} {
set site "http://www.mysite.com"
set useragent "Lynx"
set timeout "5000"; # 1000 = 1 second
http::config -useragent $useragent
set token [http::geturl $site -timeout 5000]
if {[http::status $token] == "error"} {
putserv "NOTICE $nickname :Welcome! the site $site is OFFLINE!"
} else {
putserv "NOTICE $nickname :Welcome! the site $site is ONLINE!"
}
http::cleanup $token
}
}
Not tested.
r0t3n @ #r0t3n @ Quakenet
iamdeath
Master
Posts: 323 Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:
Post
by iamdeath » Wed Jul 04, 2007 4:04 pm
DragnLord wrote: iamdeath wrote: It's not in English so atleast I can't help I am sorry.
Snorly wrote: u can make it in English and i will edit it.
I believe iamdeath meant the websites.
That's right. I could'nt understand the web language.
|AmDeAtH @ Undernet
Death is only the *Beginning*...