<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19334" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2013-02-08T08:19:55-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19334</id>

		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-02-08T08:19:55-04:00</updated>

		<published>2013-02-08T08:19:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100919#p100919</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100919#p100919"/>
		<title type="html"><![CDATA[Check if a website is up and change the topic to match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100919#p100919"><![CDATA[
The final version would be <br><br><div class="codebox"><p>Code: </p><pre><code>bind TIME - * checkHostReachableset temp(chan) "#channel"set temp(url) "www.chanrank.com"package require httpproc checkHostReachable {min hour day month year} {global tempif {[catch {set tok [http::geturl "http://$temp(url)"]http::cleanup $tokreturn 1} err]} {if {[string match -nocase "*host is unreachable*" $err]} {putserv "TOPIC $temp(chan) :Website is down"} else {putserv "TOPIC $temp(chan) :Website is UP"}}}</code></pre></div>yet i tested another version<br><div class="codebox"><p>Code: </p><pre><code>bind time - * change:topicset temp(chan) "#channel"set temp(website) "www.website"proc change:topic {min hour day month year} {global tempset website [http::config -useragent "Mozilla"]set website [http::geturl "http://$temp(website)" -timeout 50000]set updown [http::status $website]set err [http::error $website]http::cleanup $websiteswitch -exact -- $updown {"ok" {putserv "TOPIC $temp(chan) :the website is UP"}"eof" {putserv "TOPIC $temp(chan) :the website is down"}error {putserv "TOPIC $temp(chan) :Website is $err"}}}</code></pre></div>yet at the second version i couldnt test the EOF part it only worked if the website was UP and running but i heard the second version is more likely to be as it shouldl<br><br><strong class="text-strong">So use the first version</strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Fri Feb 08, 2013 8:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tintin]]></name></author>
		<updated>2013-02-07T03:36:39-04:00</updated>

		<published>2013-02-07T03:36:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100917#p100917</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100917#p100917"/>
		<title type="html"><![CDATA[Check if a website is up and change the topic to match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100917#p100917"><![CDATA[
Iv searched google and the archive, maybe I missed something but either way I'm putting this request here. If you know of something let me know what to search for or where to look. I don't mind doing some more digging.<br><br>What I'm looking for is a script that checks if a configured website is up eg returning the html status code 200 this can just be from a trigger, and then update the topic to say the website is up or down or just poke fun of the person if the site not down on a check.<br><br>I'm not afraid of a little work but I'm no coder the best I can do is edit existing scripts.<br><br>Thanks for any help.<br><br>Tintin<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12187">tintin</a> — Thu Feb 07, 2013 3:36 am</p><hr />
]]></content>
	</entry>
	</feed>
