| View previous topic :: View next topic |
| Author |
Message |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Sat Jun 30, 2007 5:20 am Post subject: online/offline in a greet |
|
|
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  _________________ Si-Shell |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Sun Jul 01, 2007 9:28 am Post subject: |
|
|
i see no one replayed so this is hard?
you cant do it? _________________ Si-Shell |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Jul 01, 2007 11:23 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Mon Jul 02, 2007 8:31 am Post subject: |
|
|
oh i see tnx anyway _________________ Si-Shell |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Mon Jul 02, 2007 10:41 am Post subject: |
|
|
What's the website you will check status on/off ? _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Jul 03, 2007 6:17 pm Post subject: |
|
|
It's not in English so atleast I can't help I am sorry. _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Wed Jul 04, 2007 8:33 am Post subject: |
|
|
u can make it in English and i will edit it.  _________________ Si-Shell |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Jul 04, 2007 9:22 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Wed Jul 04, 2007 12:09 pm Post subject: |
|
|
oh ok i have some other website to check
so can u make it for -> http://www.filelist.org ? _________________ Si-Shell |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Jul 04, 2007 12:51 pm Post subject: |
|
|
| Code: | 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.  |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Wed Jul 04, 2007 1:06 pm Post subject: |
|
|
yes thats it can u add that i set a channel i dont want to greet with this on all channels  _________________ Si-Shell |
|
| Back to top |
|
 |
Snorly Voice
Joined: 17 Apr 2006 Posts: 25
|
Posted: Wed Jul 04, 2007 1:28 pm Post subject: |
|
|
and btw the bot does not greet me :S
thats what happends when i rehash the bot
[19:29:10] <h3lp> [19:50] -h3lp (help@users.si-shell.net)- Welcome! the site http://www.si-shell.net is OFFLINE!
but the web page is online _________________ Si-Shell |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Wed Jul 04, 2007 2:00 pm Post subject: |
|
|
Just because an error is returned doesn't mean its offline, speechles should of checked the error.
Maybe something like below:
| Code: | 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 |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Wed Jul 04, 2007 4:04 pm Post subject: |
|
|
| 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*... |
|
| Back to top |
|
 |
|