<?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/20350" />

	<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>2019-12-23T21:14:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[a_aa]]></name></author>
		<updated>2019-12-23T21:14:41-04:00</updated>

		<published>2019-12-23T21:14:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107963#p107963</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107963#p107963"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107963#p107963"><![CDATA[
Awesome script, works great in reporting. I was just curious if there is a way to only have it report on earthquakes within a geographical region, say North America? Would be nice to only have USA and Canada show.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12534">a_aa</a> — Mon Dec 23, 2019 9:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[roger]]></name></author>
		<updated>2018-10-15T08:11:59-04:00</updated>

		<published>2018-10-15T08:11:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107107#p107107</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107107#p107107"/>
		<title type="html"><![CDATA[earthquake]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107107#p107107"><![CDATA[
i guess being a stubborn old goat pays off.<br> finnaly figgured out i didn't have tls loaded properly, once that was resolved the scrip works fantastic <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br>  thx for this<br>     roger<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12747">roger</a> — Mon Oct 15, 2018 8:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[roger]]></name></author>
		<updated>2018-09-13T15:21:27-04:00</updated>

		<published>2018-09-13T15:21:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107064#p107064</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107064#p107064"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107064#p107064"><![CDATA[
just to muddy the waters, lol, i forgot to unload the script and this morning it posted this. <br> <br> USGS Earthquake: M5.3, South of the Kermadec Islands (1 hour 46 seconds ago) &gt;&gt; <a href="https://earthquake.usgs.gov/earthquakes/eventpage/us2000he2j" class="postlink">https://earthquake.usgs.gov/earthquakes ... us2000he2j</a><br><br><br>only showed once<br><br>then original error came back<br><br>SSL channel "sock16e2f20": error: sslv3 alert handshake failure<br><br>so i don't know whats going on lol<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12747">roger</a> — Thu Sep 13, 2018 3:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Merky]]></name></author>
		<updated>2018-09-13T14:36:33-04:00</updated>

		<published>2018-09-13T14:36:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107063#p107063</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107063#p107063"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107063#p107063"><![CDATA[
error in ubuntu<div class="codebox"><p>Code: </p><pre><code>Wrong # args: should be "tls::socket ?options? host port" ( https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom )</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8625">Merky</a> — Thu Sep 13, 2018 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[roger]]></name></author>
		<updated>2018-09-13T13:14:14-04:00</updated>

		<published>2018-09-13T13:14:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107061#p107061</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107061#p107061"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107061#p107061"><![CDATA[
never did work for me, i forget the original error but read enough about ppl getting it working fine to think it is something in my config and not in the script, i'm 64 and no one helps me with this stuff except google.<br>  sometimes i get beat, it happens, smart enough to know like i said, prob something i did wrong somewhere else. as far as an update, well if there ever is one i'll try again, i'm stubborn like that, if there isn't one, so be it, i'll ask the devil the answer, that is if he lifts that restraining order against me<br>   like your scripts<br>    roger <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12747">roger</a> — Thu Sep 13, 2018 1:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2018-09-12T18:41:33-04:00</updated>

		<published>2018-09-12T18:41:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107059#p107059</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107059#p107059"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107059#p107059"><![CDATA[
Won't be another update as it is working for me here and I can't force mine to throw an error:)<br><br>A fix will only comes if someone having the problem will help us find their cure.<br>I have only been aware of your problems for a day or two.<br><br>You might also look at this string -&gt; <a href="http://forum.egghelp.org/viewtopic.php?t=20506" class="postlink">http://forum.egghelp.org/viewtopic.php?t=20506</a><br><br>Was the script working for you at some point?<br>What was the initial error when it stopped working for you, before you tried to fix it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Sep 12, 2018 6:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[roger]]></name></author>
		<updated>2018-09-12T14:57:32-04:00</updated>

		<published>2018-09-12T14:57:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107058#p107058</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107058#p107058"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107058#p107058"><![CDATA[
never mind, i have given up on this script, i'm pretty sure it's something i did but after 3 weeks of messing with it it has beat me. as stubborn as i am i have to give up, maybe wait for another update <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12747">roger</a> — Wed Sep 12, 2018 2:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[roger]]></name></author>
		<updated>2018-09-11T23:30:03-04:00</updated>

		<published>2018-09-11T23:30:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107054#p107054</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107054#p107054"/>
		<title type="html"><![CDATA[trying]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107054#p107054"><![CDATA[
eggdrop 1.8<br>ubuntu 14.04<br> got all sorts of errors with 1.2<br><br>loaded v1.3 now get this<br><br>Wrong # args: should be "tls::socket ?options? host port" ( <a href="https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom" class="postlink">https://earthquake.usgs.gov/earthquakes ... 5_day.atom</a> )<br><br>what am i doing wrong?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12747">roger</a> — Tue Sep 11, 2018 11:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2018-09-17T13:59:07-04:00</updated>

		<published>2018-09-11T21:30:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=107051#p107051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=107051#p107051"/>
		<title type="html"><![CDATA[Earthquake Announcer  v1.3 by SpiKe^^]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=107051#p107051"><![CDATA[
This version fixes the recent tls error:<br>Error flushing "sock2322280": connection reset by peer ( <a href="https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom" class="postlink">https://earthquake.usgs.gov/earthquakes ... 5_day.atom</a> )<br>See this: <a href="http://forum.egghelp.org/viewtopic.php?t=20503" class="postlink">http://forum.egghelp.org/viewtopic.php?t=20503</a><br><div class="codebox"><p>Code: </p><pre><code>########################################################## Earthquake Announcer  v1.3 by SpiKe^^   11/09/2018 ####   =&gt; All original script credits to speechles &lt;=   ####   http://forum.egghelp.org/viewtopic.php?t=20350   ########################################################### Earthquake .. rumble rumble rumble# This script will announce earthquakes just like an rss script# as well as allowing users to type commands and see# the latest news via notice as well. Fully configurable.# Enjoy, and may the force be with you.... always....# speechles was here :P################################################################## -&gt; NEW IN VERSION 1.3 &lt;-                                   ####  -Fixes the recent tls error:                              ####   Error flushing "sock2322280": connection reset by peer...#################################################################### VERSION 1.2  -  08/10/2017                                 ####  -New page address &amp; parsing regex (thanks thommey)        ####  -Now supports ssl page address (new page is https)        #################################################################### Enable script per #channel, in partyline, use:             ####  .chanset #channel +earthquake                             ####                                                            #### Public and PrivateMessage commands:                        ####  !eq     :Say the 5 most recent earthquake events          ####  !eq 4+  :Say the last 5 events M4.0 or larger             #################################################################### New feed reader code:                                      ####   no longer misses events posted out-of-order!             ##################################################################package require httppackage require tlssetudef flag earthquakenamespace eval eqnews {   # config - make your changes here   # trigger character   set ary(pref) "!"   # command used to reply to user   # this can be a list of space delimited commands   set ary(commands) "eq earthquake"   # amount user can issue before throttle   set ary(throttle) 2   # throttle time   set ary(throttle_time) 30   # time to announce new news items   # this can be a list of space delimited time binds.   # the one you wish to use for bind_time uncommented.   # set ary(bind_time) "00* 15* 30* 45*" ; # every 15 minutes   # set ary(bind_time) "00* 30*" ; # every 30 minutes   set ary(bind_time) "?0* ?5*" ; # every 5 minutes   # url to news page  (all available feeds)   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_day.atom ; # only significant   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.atom ; # 4.5 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom ; # 2.5 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_day.atom ; # 1.0 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.atom ; # all   set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom   # minimum magnitude to show of quakes   # everything equal to or above this magnitude   # will be shown and this only affects the automation...   # this should be larger than what is used in ary(page)   set ary(magnitude) 4   # max age (in minutes) of earthquakes to show      &lt;- New Setting &lt;-   # this only affects the automation...   # this should be 120 minutes or more  (def: 300)   set ary(old) 300   # parsing regex used to gather news   set ary(regex) {&lt;entry&gt;.*?&lt;title&gt;(.*?)&lt;/title&gt;&lt;updated&gt;(.*?)&lt;/updated&gt;.*?href="https://earthquake.usgs.gov/earthquakes/eventpage/(.*?)".*?&lt;dt&gt;Time&lt;/dt&gt;&lt;dd&gt;(.*?)&lt;/dd&gt;}   # max amount of news items to announce   set ary(max_bot) 5   # max amount of news items for users   set ary(max_user) 5   # display format for news messages, variables are: %mag, %title, %ago, %event    # these can be used and will be replaced with actual values, newline (\n) will   # let you span multiple lines if you wish. If something is too long it will   # be cut off, be aware of this... use colors, bold, but remember to \escape any   # special tcl characters.    set ary(display_format) "\002USGS Earthquake\002: M\002%mag\002, %title (%ago ago) &gt;&gt; https://earthquake.usgs.gov/earthquakes/eventpage/%event"}# bindsforeach bind [split $::eqnews::ary(commands)] {   bind pub -|- "$::eqnews::ary(pref)$bind" ::eqnews::pub_   bind msg -|- "$::eqnews::ary(pref)$bind" ::eqnews::msg_}foreach bind [split $::eqnews::ary(bind_time)] {   bind time - $bind ::eqnews::magic_}bind time - ?0* ::eqnews::throttleclean_namespace eval eqnews {   # script version   set ary(version) "1.3"   # main - time bind - magic   proc magic_ {args} {     news_ $::botnick "-" "-" "all" "-" "privmsg"   }   # main - msg bind - notice   proc msg_ {nick uhost hand arg} {     news_ $nick $uhost $hand $nick $arg "notice"   }   # main - pub bind - privmsg   proc pub_ {nick uhost hand chan arg} {     if {[channel get $chan earthquake]} {       news_ $nick $uhost $hand $chan $arg "privmsg"     }   }   # sub - open an ssl session   # see http://wiki.tcl.tk/2630 :thanks caesar   proc tls:socket args {       set opts [lrange $args 0 end-2]       set host [lindex $args end-1]       set port [lindex $args end]       ::tls::socket -servername $host {*}$opts $host $port    }    # sub - give news   proc news_ {nick uhost hand chan arg how} {      if {![botonchan]} {  return  }      if {[isbotnick $nick]} {  set magic 1  } else {  set magic 0  }      if {$magic==0 &amp;&amp; [throttle_ $uhost,$chan,news $::eqnews::ary(throttle_time)]} {        putserv "$how $chan :$nick, you have been Throttled! Your going too fast and making my head spin!"        return      }      set a "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"      set t [::http::config -useragent $a]      #::http::register https 443 [list ::tls::socket -tls1 1]  ;# added: plat_ #      #::http::register https 443 ::tls::socket      ::http::register https 443 ::eqnews::tls:socket      catch { set t [::http::geturl $::eqnews::ary(page) -timeout 30000] } error      # error condition 1, socket error or other general error      if {![string match -nocase "::http::*" $error]} {        if {$magic==0} {          putserv "$how $chan :[string totitle [string map {"\n" " | "} $error]] \( $::eqnews::ary(page) \)"        }        return      }      # error condition 2, http error      if {![string equal -nocase [::http::status $t] "ok"]} {        if {$magic==0} {          putserv "$how $chan :[string totitle [::http::status $t]] \( $::eqnews::ary(page) \)"        }        return      }      set html [::http::data $t]      ::http::cleanup $t      # new feed reader code # added: SpiKe^^ # no longer misses events posted out-of-order! #      set last 0 ; set events "" ; set min 0 ; set old 0      set now [clock seconds]      if {$magic==1} {  set max $::eqnews::ary(max_bot)        set min $::eqnews::ary(magnitude)        set old [expr {$now - ($::eqnews::ary(old) * 60)}]        if {[info exists ::eqnews::ary(last)]} {          set last $::eqnews::ary(last)  ;  set events $::eqnews::ary(events)        }      } else {  set max $::eqnews::ary(max_user)        if {[string is double -strict [set arg [string trim $arg " +"]]]} {          set min $arg        }      }      set c 0  ;  set first 0      foreach line [lrange [split $html "\n"] 1 end] {        if {[regexp -- "$::eqnews::ary(regex)" $line x title posted event etime]} {          #putlog "=&gt; ($title) ($posted) ($event) ($etime)"          # =&gt; (M 4.5 - 74km SSE of Phek, India) (2017-10-03T15:01:03.040Z) (us2000b0gm) (2017-10-03 13:48:34 UTC)          set posted [string map [list "T" " "] [lindex [split $posted .] 0]]          set postid [clock scan "$posted UTC"]          if {$first==0} {  set first $postid  }          set id [clock scan $etime]          if {$id&lt;$old} {  break  }          set mag [lindex [split $title] 1]          if {$mag&lt;$min || $postid&lt;=$last || [lsearch -exact $events $event]&gt;-1} {            continue          }          set etime [string trimright $etime " UTC"]          set title [mapit_ [string trim [join [lrange [split $title -] 1 end] -]]]          set dur [duration [expr {$now - $id}]]          if {[llength [set x [split $dur]]]&gt;4 &amp;&amp; [string match "sec*" [lindex $x end]]} {            set dur [join [lrange $x 0 end-2]]          }          set map [list "%mag" $mag "%title" $title "%ago" $dur "%event" $event]          set output [string map $map $::eqnews::ary(display_format)]          if {$magic==0} {            foreach line [split $output "\n"] {  puthelp "$how $chan :$line"  }          } else {            foreach ch [channels] {              if {[channel get $ch earthquake]} {                foreach line [split $output "\n"] { puthelp "$how $ch :$line" }              }            }            lappend events $event          }          if {[incr c] == $max} {  break  }        }      }      if {$magic==1 &amp;&amp; $first&gt;0} {  set ::eqnews::ary(last) $first  }      if {[llength $events]} {  set ::eqnews::ary(events) [lrange $events end-39 end]  }   }   # sub - map it   proc mapit_ {t} { return [string map [list "'" "'" """ "\""] $t] }   # Throttle Proc (slightly altered, super action missles) - Thanks to user   # see this post: http://forum.egghelp.org/viewtopic.php?t=9009&amp;start=3   proc throttle_ {id seconds} {      if {[info exists ::eqnews::throttle($id)]&amp;&amp;[lindex $::eqnews::throttle($id) 0]&gt;[clock seconds]} {         set ::eqnews::throttle($id) [list [lindex $::eqnews::throttle($id) 0] [set value [expr {[lindex $::eqnews::throttle($id) 1] +1}]]]         if {$value &gt; $::eqnews::ary(throttle)} { set id 1 } { set id 0 }      } {         set ::eqnews::throttle($id) [list [expr {[clock seconds]+$seconds}] 1]         set id 0      }   }   # sub - clean throttled users   proc throttleclean_ {args} {      set now [clock seconds]      foreach {id time} [array get ::eqnews::throttle] {         if {[lindex $time 0]&lt;=$now} {unset ::eqnews::throttle($id)}      }   }}putlog "Earthquake Announcer v$::eqnews::ary(version) loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Sep 11, 2018 9:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[a_aa]]></name></author>
		<updated>2018-02-16T09:43:32-04:00</updated>

		<published>2018-02-16T09:43:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106691#p106691</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106691#p106691"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106691#p106691"><![CDATA[
<blockquote class="uncited"><div>You mean formatting the output with colour codes? Check out <a href="http://forum.egghelp.org/viewtopic.php?t=3867" class="postlink">Colour and formatting codes</a> in <a href="http://forum.egghelp.org/viewforum.php?f=7" class="postlink">Tcl FAQ</a> section.</div></blockquote>Perfect....thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12534">a_aa</a> — Fri Feb 16, 2018 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2018-02-16T03:06:44-04:00</updated>

		<published>2018-02-16T03:06:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106688#p106688</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106688#p106688"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106688#p106688"><![CDATA[
You mean formatting the output with colour codes? Check out <a href="http://forum.egghelp.org/viewtopic.php?t=3867" class="postlink">Colour and formatting codes</a> in <a href="http://forum.egghelp.org/viewforum.php?f=7" class="postlink">Tcl FAQ</a> section.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 16, 2018 3:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[a_aa]]></name></author>
		<updated>2018-02-15T22:51:17-04:00</updated>

		<published>2018-02-15T22:51:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106686#p106686</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106686#p106686"/>
		<title type="html"><![CDATA[Text outpu]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106686#p106686"><![CDATA[
Newb question here, but hopefully someone can point me in the right direction. I would like the text to be outputted to a color other than black. Is there a easy way to accomplish this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12534">a_aa</a> — Thu Feb 15, 2018 10:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ezekiel]]></name></author>
		<updated>2017-10-10T05:45:01-04:00</updated>

		<published>2017-10-10T05:45:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106474#p106474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106474#p106474"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106474#p106474"><![CDATA[
cool! looking forward <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12473">Ezekiel</a> — Tue Oct 10, 2017 5:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2017-10-09T10:53:22-04:00</updated>

		<published>2017-10-09T10:53:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106469#p106469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106469#p106469"/>
		<title type="html"><![CDATA[Earthquake Announcer v1.2 by SpiKe^^]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106469#p106469"><![CDATA[
Released a more finished earthquake v1.2 to the archive at <a href="http://www.tclarchive.org/view.php?id=1792" class="postlink">http://www.tclarchive.org/view.php?id=1792</a><br><br>This is the new updated code from that release...<div class="codebox"><p>Code: </p><pre><code>########################################################## Earthquake Announcer  v1.2 by SpiKe^^   08/10/2017 ####   =&gt; All original script credits to speechles &lt;=   ####   http://forum.egghelp.org/viewtopic.php?t=20350   ########################################################### Earthquake .. rumble rumble rumble# This script will announce earthquakes just like an rss script# as well as allowing users to type commands and see# the latest news via notice as well. Fully configurable.# Enjoy, and may the force be with you.... always....# speechles was here :P########################################################## Updated:                                           ####  -New page address &amp; parsing regex (thanks thommey)####  -Now supports ssl page address (new page is https)############################################################ Enable script per #channel, in partyline, use:     ####  .chanset #channel +earthquake                     ####                                                    #### Public and PrivateMessage commands:                ####  !eq     :Say the 5 most recent earthquake events  ####  !eq 4+  :Say the last 5 events M4.0 or larger     ## &lt;- New Command &lt;-########################################################## New feed reader code:                              ####   no longer misses events posted out-of-order!     ##########################################################package require httppackage require tlssetudef flag earthquakenamespace eval eqnews {   # config - make your changes here   # trigger character   set ary(pref) "!"   # command used to reply to user   # this can be a list of space delimited commands   set ary(commands) "eq earthquake"   # amount user can issue before throttle   set ary(throttle) 2   # throttle time   set ary(throttle_time) 30   # time to announce new news items   # this can be a list of space delimited time binds.   # the one you wish to use for bind_time uncommented.   # set ary(bind_time) "00* 15* 30* 45*" ; # every 15 minutes   # set ary(bind_time) "00* 30*" ; # every 30 minutes   set ary(bind_time) "?0* ?5*" ; # every 5 minutes   # url to news page  (all available feeds)   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_day.atom ; # only significant   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.atom ; # 4.5 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom ; # 2.5 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_day.atom ; # 1.0 and greater only   #set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.atom ; # all   set ary(page) https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom   # minimum magnitude to show of quakes   # everything equal to or above this magnitude   # will be shown and this only affects the automation...   # this should be larger than what is used in ary(page)   set ary(magnitude) 4   # max age (in minutes) of earthquakes to show      &lt;- New Setting &lt;-   # this only affects the automation...   # this should be 120 minutes or more  (def: 300)   set ary(old) 300   # parsing regex used to gather news   set ary(regex) {&lt;entry&gt;.*?&lt;title&gt;(.*?)&lt;/title&gt;&lt;updated&gt;(.*?)&lt;/updated&gt;.*?href="https://earthquake.usgs.gov/earthquakes/eventpage/(.*?)".*?&lt;dt&gt;Time&lt;/dt&gt;&lt;dd&gt;(.*?)&lt;/dd&gt;}   # max amount of news items to announce   set ary(max_bot) 5   # max amount of news items for users   set ary(max_user) 5   # display format for news messages, variables are: %mag, %title, %ago, %event    # these can be used and will be replaced with actual values, newline (\n) will   # let you span multiple lines if you wish. If something is too long it will   # be cut off, be aware of this... use colors, bold, but remember to \escape any   # special tcl characters.    set ary(display_format) "\002USGS Earthquake\002: M\002%mag\002, %title (%ago ago) &gt;&gt; https://earthquake.usgs.gov/earthquakes/eventpage/%event"}# bindsforeach bind [split $::eqnews::ary(commands)] {   bind pub -|- "$::eqnews::ary(pref)$bind" ::eqnews::pub_   bind msg -|- "$::eqnews::ary(pref)$bind" ::eqnews::msg_}foreach bind [split $::eqnews::ary(bind_time)] {   bind time - $bind ::eqnews::magic_}bind time - ?0* ::eqnews::throttleclean_namespace eval eqnews {   # script version   set ary(version) "1.2"   # main - time bind - magic   proc magic_ {args} {     news_ $::botnick "-" "-" "all" "-" "privmsg"   }   # main - msg bind - notice   proc msg_ {nick uhost hand arg} {     news_ $nick $uhost $hand $nick $arg "notice"   }   # main - pub bind - privmsg   proc pub_ {nick uhost hand chan arg} {     if {[channel get $chan earthquake]} {       news_ $nick $uhost $hand $chan $arg "privmsg"     }   }   # sub - give news   proc news_ {nick uhost hand chan arg how} {      if {![botonchan]} {  return  }      if {[isbotnick $nick]} {  set magic 1  } else {  set magic 0  }      if {$magic==0 &amp;&amp; [throttle_ $uhost,$chan,news $::eqnews::ary(throttle_time)]} {        putserv "$how $chan :$nick, you have been Throttled! Your going too fast and making my head spin!"        return      }      set a "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"      set t [::http::config -useragent $a]      ::http::register https 443 [list ::tls::socket -tls1 1]  ;# added: plat_ #      catch { set t [::http::geturl $::eqnews::ary(page) -timeout 30000] } error      # error condition 1, socket error or other general error      if {![string match -nocase "::http::*" $error]} {        if {$magic==0} {          putserv "$how $chan :[string totitle [string map {"\n" " | "} $error]] \( $::eqnews::ary(page) \)"        }        return      }      # error condition 2, http error      if {![string equal -nocase [::http::status $t] "ok"]} {        if {$magic==0} {          putserv "$how $chan :[string totitle [::http::status $t]] \( $::eqnews::ary(page) \)"        }        return      }      set html [::http::data $t]      ::http::cleanup $t      # new feed reader code # added: SpiKe^^ # no longer misses events posted out-of-order! #      set last 0 ; set events "" ; set min 0 ; set old 0      set now [clock seconds]      if {$magic==1} {  set max $::eqnews::ary(max_bot)        set min $::eqnews::ary(magnitude)        set old [expr {$now - ($::eqnews::ary(old) * 60)}]        if {[info exists ::eqnews::ary(last)]} {          set last $::eqnews::ary(last)  ;  set events $::eqnews::ary(events)        }      } else {  set max $::eqnews::ary(max_user)        if {[string is double -strict [set arg [string trim $arg " +"]]]} {          set min $arg        }      }      set c 0  ;  set first 0      foreach line [lrange [split $html "\n"] 1 end] {        if {[regexp -- "$::eqnews::ary(regex)" $line x title posted event etime]} {          #putlog "=&gt; ($title) ($posted) ($event) ($etime)"          # =&gt; (M 4.5 - 74km SSE of Phek, India) (2017-10-03T15:01:03.040Z) (us2000b0gm) (2017-10-03 13:48:34 UTC)          set posted [string map [list "T" " "] [lindex [split $posted .] 0]]          set postid [clock scan "$posted UTC"]          if {$first==0} {  set first $postid  }          set id [clock scan $etime]          if {$id&lt;$old} {  break  }          set mag [lindex [split $title] 1]          if {$mag&lt;$min || $postid&lt;=$last || [lsearch -exact $events $event]&gt;-1} {            continue          }          set etime [string trimright $etime " UTC"]          set title [mapit_ [string trim [join [lrange [split $title -] 1 end] -]]]          set dur [duration [expr {$now - $id}]]          if {[llength [set x [split $dur]]]&gt;4 &amp;&amp; [string match "sec*" [lindex $x end]]} {            set dur [join [lrange $x 0 end-2]]          }          set map [list "%mag" $mag "%title" $title "%ago" $dur "%event" $event]          set output [string map $map $::eqnews::ary(display_format)]          if {$magic==0} {            foreach line [split $output "\n"] {  puthelp "$how $chan :$line"  }          } else {            foreach ch [channels] {              if {[channel get $ch earthquake]} {                foreach line [split $output "\n"] { puthelp "$how $ch :$line" }              }            }            lappend events $event          }          if {[incr c] == $max} {  break  }        }      }      if {$magic==1 &amp;&amp; $first&gt;0} {  set ::eqnews::ary(last) $first  }      if {[llength $events]} {  set ::eqnews::ary(events) [lrange $events end-39 end]  }   }   # sub - map it   proc mapit_ {t} { return [string map [list "'" "'" """ """] $t] }   # Throttle Proc (slightly altered, super action missles) - Thanks to user   # see this post: http://forum.egghelp.org/viewtopic.php?t=9009&amp;start=3   proc throttle_ {id seconds} {      if {[info exists ::eqnews::throttle($id)]&amp;&amp;[lindex $::eqnews::throttle($id) 0]&gt;[clock seconds]} {         set ::eqnews::throttle($id) [list [lindex $::eqnews::throttle($id) 0] [set value [expr {[lindex $::eqnews::throttle($id) 1] +1}]]]         if {$value &gt; $::eqnews::ary(throttle)} { set id 1 } { set id 0 }      } {         set ::eqnews::throttle($id) [list [expr {[clock seconds]+$seconds}] 1]         set id 0      }   }   # sub - clean throttled users   proc throttleclean_ {args} {      set now [clock seconds]      foreach {id time} [array get ::eqnews::throttle] {         if {[lindex $time 0]&lt;=$now} {unset ::eqnews::throttle($id)}      }   }}putlog "Earthquake Announcer v$::eqnews::ary(version) loaded."</code></pre></div><blockquote class="uncited"><div>can be updated with a short url method? tiny, bit.ly?</div></blockquote>I'm sure it could be added, just not sure how.<br>I may look into that...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Oct 09, 2017 10:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ezekiel]]></name></author>
		<updated>2017-10-09T03:29:56-04:00</updated>

		<published>2017-10-09T03:29:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106467#p106467</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106467#p106467"/>
		<title type="html"><![CDATA[earthquake bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106467#p106467"><![CDATA[
great job SpiKe^^  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br>can be updated with a short url method? tiny, bit.ly?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12473">Ezekiel</a> — Mon Oct 09, 2017 3:29 am</p><hr />
]]></content>
	</entry>
	</feed>
