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

	<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>2006-08-02T16:01:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[fauves]]></name></author>
		<updated>2006-08-02T16:01:39-04:00</updated>

		<published>2006-08-02T16:01:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65102#p65102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65102#p65102"/>
		<title type="html"><![CDATA[RSS Help (bug)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65102#p65102"><![CDATA[
thank u very much scotteh, thist tcl is 100%<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7600">fauves</a> — Wed Aug 02, 2006 4:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[scotteh]]></name></author>
		<updated>2006-08-01T12:21:52-04:00</updated>

		<published>2006-08-01T12:21:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65073#p65073</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65073#p65073"/>
		<title type="html"><![CDATA[RSS Help (bug)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65073#p65073"><![CDATA[
Actually in this case it was a bug, There is some bad error checking for triggers in that version. It does a wildcard match on any text typed to the channel against the trigger, so * would match all triggers.<br><br>This bug was fixed in v0.3b1 (<a href="http://labs.wizzer-it.com/projects/rss-synd/rss-synd-0.3b1.zip" class="postlink">http://labs.wizzer-it.com/projects/rss- ... -0.3b1.zip</a>).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7303">scotteh</a> — Tue Aug 01, 2006 12:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-08-01T06:55:26-04:00</updated>

		<published>2006-08-01T06:55:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65060#p65060</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65060#p65060"/>
		<title type="html"><![CDATA[RSS Help (bug)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65060#p65060"><![CDATA[
It's NOT a 'bug'! It is the intended method of sending so a channel does not get spammed by useless information that no other user wishes to digest.<br><br>Suggestions and/or bug reports can be sent to the script author (<a href="mailto:andrew.scott@wizzer-it.com">andrew.scott@wizzer-it.com</a>).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Tue Aug 01, 2006 6:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fauves]]></name></author>
		<updated>2006-08-01T03:57:16-04:00</updated>

		<published>2006-08-01T03:57:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=65058#p65058</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=65058#p65058"/>
		<title type="html"><![CDATA[RSS Help (bug)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=65058#p65058"><![CDATA[
Hi,<br><br>when i write "*" or "***..." on channel , the eggdrop send all notices to pvt. can u help me, and remove this bug please?<br><br><br><div class="codebox"><p>Code: </p><pre><code>################################################################################# Copyright (c) 2005, Andrew Scott# All rights reserved.## Redistribution and use in source and binary forms, with or without# modification, are permitted provided that the following conditions are met:##    * Redistributions of source code must retain the above copyright notice,#      this list of conditions and the following disclaimer.#    * Redistributions in binary form must reproduce the above copyright#      notice, this list of conditions and the following disclaimer in the#      documentation and/or other materials provided with the distribution.#    * Neither the name of the author nor the names of its contributors#      may be used to endorse or promote products derived from this software#      without specific prior written permission.## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE# POSSIBILITY OF SUCH DAMAGE.## Eggdrop RSS Syndication# -----------------------#   Date: 2005-08-23#   Version: v0.1#   Author(s): Andrew Scott &lt;andrew.scott@wizzer-it.com&gt; (2005-08-23)### Setup:##   Follow the examples below. It is possible to define values in either the#     default variable or within the individual rss feed variables. You can#     define values in both places, but each feeds individual settings will#     overwrite the default ones.## Values:##  Required:#   url            The URL of the RSS feed.#   channels       List of channels the feed (and trigger) are to be active#                    in. (Use space to seperate multiple channels)#   database       Full (or relative from your eggdrops path) path to where#                    you would like to store the database file.#   output         The format you would like the RSS to be outputted to you#                    channel in#   max-depth      Maximum amount of times the script should follow#                    Location: headers. Keep this relativly low.#   update         How often (in minutes) to check for updates.#   timeout        Timeout of connections (in milliseconds).#   useragent      User agent to send in the http request.##  Optional:#   trigger        Public trigger to list feeds. (if you only want to define#                    it once in default use @@feedid@@, this will be#                    replaced by each individual feeds id)#   eval-tcl       Evaluate the output before sending it to channel (1 = on)#   max-output     Maximum articles to output#   remove-empty   Remove empty cookies from the output (1 = on)## Cookies:##   The output value works on a cookie system, in this case its dynamic so#     it depends on what data the feed contains as to what you can output.##   There are two different type of cookies 'channel' ones and 'item' ones.#     the 'channel' one contains information about the feed, eg 'title'.#     the 'item' one contains information about each individual article.#     For instance if you want to output the title of an item you would use:#     @@item:title@@ Again if you wanted to output a custom tag from within#     and item you would do something like: @@item:customTag@@.### History:##   v0.1 (2005-08-23)#     - Initial release### Start of Settings#namespace eval ::rss-synd {variable rssset rss(slashdot){ "url""http://www.record.pt/rss/rss.asp?idcanal=1024" "database""./scripts/jogos.db" "output""\\\[\002Jogos\002\\\] @@item:title@@" "trigger""!jogos" "channels""#teste #@SCP" "eval-tcl"1}set rss(theregister){ "url""http://www.portalfutebol.net/rss/resultados.asp" "output""@@item:title@@" "database""./scripts/resultados.db" "channels""#teste #@SCP" "trigger""!resultados" "eval-tcl"1}set rss(mercado){ "url""http://www.portalfutebol.net/rss/transferencias.asp" "output""\\\[\002Mercado\002\\\] @@item:title@@ • \037\Leia Mais\037\: @@item:link@@" "database""./scripts/mercado.db" "channels""#teste #@SCP" "trigger""!mercado" "eval-tcl"1}#set rss(livescore){# "url""http://www.elmarcador.com/rss/feed.aspx"# "output""\\\[\002LiveScore\002\\\] @@item:title@@"# "database""./scripts/livescore.db"# "channels""#teste #@SCP"# "trigger""!livescore"# "eval-tcl"1#}set rss(noticias){ "url""http://www.record.pt/rss/rss.asp?idcanal=24" "output""\\\[\002Noticias\002\\\] @@item:title@@ • \037\Leia Mais\037\: @@item:link@@" "database""./scripts/noticias.db" "channels""#teste #@SCP" "trigger""!noticias" "eval-tcl"1}set default{ "max-output"8 "remove-empty"1 "max-depth"5 "eval-tcl"0 "update"0 "timeout"30000 "channels""#teste #@SCP" "trigger""!rss @@feedid@@" "output""[\002@@channel:title@@\002] @@item:title@@ - @@item:link@@" "useragent""Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6"}}## End of Settings################################################################################proc ::rss-synd::init {args} {variable rssvariable defaultpackage require httpforeach feed [array names rss] {array set tmp $defaultarray set tmp $rss($feed)set required [list "max-depth" "update" "timeout" "channels" "output" "useragent" "url" "database"]foreach {key value} [array get tmp] {if {[set ptr [lsearch -exact $required $key]] &gt;= 0} {set required [lreplace $required $ptr $ptr]}}regsub -nocase -all -- {@@feedid@@} $tmp(trigger) $feed tmp(trigger)if {[llength $required] == 0} {if {([file exists $tmp(database)]) &amp;&amp; ([set mtime [file mtime $tmp(database)]] &lt; [unixtime])} {set tmp(updated) [file mtime $tmp(database)]} else {set tmp(updated) 0}set rss($feed) [array get tmp]} else {putlog "\002RSS Error\002: Unable to load feed \"$feed\", missing one or more required settings. \"[join $required ", "]\""unset rss($feed)}unset tmp}bind evnt -|- prerehash [namespace current]::deInitbind TIME -|- {* * * * *} [namespace current]::getFeedsbind pubm -|- {* *} [namespace current]::pubFeeds}proc ::rss-synd::deInit {args} {catch {unbind evnt -|- prerehash [namespace current]::deInit}catch {unbind time -|- {* * * * *} [namespace current]::getFeeds}catch {unbind pubm -|- {* *} [namespace current]::pubFeeds}namespace delete [namespace current]}proc ::rss-synd::getFeeds {args} {variable rssset i 0foreach name [array names rss] {if {$i == 3} { break }array set feed $rss($name)if {$feed(updated) &lt;= [expr { [unixtime] - ($feed(update) * 60) }]} {::http::config -useragent $feed(useragent)catch {::http::geturl "$feed(url)" -command "[namespace current]::processFeed {[array get feed] depth 0}" -timeout $feed(timeout)}set feed(updated) [unixtime]set rss($name) [array get feed]incr i}unset feed}}proc ::rss-synd::pubFeeds {nick user handle chan text} {variable rssforeach name [array names rss] {array set feed $rss($name)if {[string match -nocase $text $feed(trigger)]} {if {[[namespace current]::channelCheck $feed(channels) $chan]} {set feed(channels) $nickset data ""if {[catch {open $feed(database) "r"} fp] == 0} {while {![eof $fp]} {gets $fp lineappend data $line}close $fp[namespace current]::outputFeed [array get feed] $data} else { putserv "PRIVMSG $chan :\002RSS Warning\002: [string totitle $fp]." }}}}}proc ::rss-synd::processFeed {feedlist args} {set token [lindex $args end]array set feed $feedlistupvar 0 $token stateif {![string match -nocase $state(status) "ok"]} {putlog "\002RSS Error\002: $state(url) (State: $state(status))"return 1}if {([::http::ncode $token] == 302) || ([::http::ncode $token] == 301)} {set feed(depth) [expr {$feed(depth) + 1 }]array set meta $state(meta)if {$feed(depth) &lt; $feed(max-depth)} {catch {::http::geturl "$meta(Location)" -command "[namespace current]::processFeed {[array get feed]}" -timeout $feed(timeout)}} else {putlog "\002RSS Error\002: $state(url) (State: timeout, max refer limit reached)"}return 1} elseif {[::http::ncode $token] != 200} {putlog "\002RSS Error\002: $state(url) ($state(http))"return 1}set data [::http::data $token]if {[set newsdata [[namespace current]::createList $data]] == ""} {putlog "\002RSS Error\002: Unable to parse URL properly. \"$state(url)\""return 1}::http::cleanup $tokenunset dataset oldfeed ""if {[catch {open $feed(database) "r"} fp] == 0} {while {![eof $fp]} {gets $fp lineappend oldfeed $line}close $fp} else { putlog "\002RSS Warning\002: [string totitle $fp]." }foreach {tag value} $newsdata {if {[string match -nocase $tag "rss"]} {foreach {subtag subvalue} $value {if {[string match -nocase $subtag "channel"]} {foreach {ssubtag ssubvalue} $subvalue {if {[string match -nocase $ssubtag "item"]} {lappend news(item) $ssubvalue} else {lappend news(channel) $ssubtag $ssubvalue}}}}break} elseif {[string match -nocase $tag "rdf:RDF"]} {foreach {subtag subvalue} $value {lappend news($subtag) $subvalue}break}}if {[catch {open $feed(database) "w+"} fp] == 0} {puts $fp [array get news]close $fp} else {putlog "\002RSS Error\002: [string totitle $fp]."return 1}[namespace current]::outputFeed [array get feed] [array get news] $oldfeedreturn 0}proc ::rss-synd::createList {data} {set i 0set news [list]set length [string length $data]for {set ptr 1} {$ptr &lt;= $length} {incr ptr} {set section [string range $data $i $ptr]if {[llength [set match [regexp -inline -- {&lt;(.[^ \n\r&gt;]+)(?: |\n|\r\n|\r|)(.[^&gt;]+|)&gt;} $section]]] &gt; 0} {set i [expr { $ptr + 1 } ]set tag [lindex $match 1]if {([info exists current(tag)]) &amp;&amp; ([string match -nocase $current(tag) [string map { "/" "" } $tag]])} {set subdata [string range $data $current(pos) [expr { $ptr - ([string length $tag] + 2) } ]]if {[set cdata [lindex [regexp -inline -nocase -- {&lt;!\[CDATA\[(.[^\]&gt;]*)\]\]&gt;|(.*)} $subdata] 1]] != ""} {set subdata $cdata}set result [[namespace current]::createList $subdata]if {[llength $result] &gt; 0} {lappend news $current(tag) $result} else {lappend news $current(tag) $subdata}unset current} elseif {(![string match {[!\?]*} $tag]) &amp;&amp; (![info exists current(tag)])} {set current(tag) [string map { "\r" "" "\n" "" "\t" "" } $tag]set current(pos) $i}}}return $news}proc ::rss-synd::outputFeed {feedlist newslist {oldfeed ""}} {array set feed $feedlistarray set news $newslistif {$oldfeed != ""} { array set old $oldfeed }if {[llength $oldfeed] &gt; 1} { array set last [lindex $old(item) 0] }set i 0foreach item $news(item) {array set tmp $itemif {([info exists feed(max-output)]) &amp;&amp; ($i == $feed(max-output))} { break }if {([info exists last(title)]) &amp;&amp; ([string match $last(title) $tmp(title)])} { break }putserv "PRIVMSG [join $feed(channels) ", "] :[[namespace current]::formatOutput $feedlist $news(channel) $item]"incr i}}proc ::rss-synd::formatOutput {feedlist channel item} {array set feed $feedlistset output $feed(output)if {[llength $channel] == 1} {set channel [lindex $channel 0]}foreach {tag value} $item {regsub -nocase -all -- "@@item:$tag@@" $output [string map { "&amp;" "\\\x26" } [[namespace current]::decodeHtml $value]] output}foreach {tag value} $channel {regsub -nocase -all -- "@@channel:$tag@@" $output [string map { "&amp;" "\\\x26" } [[namespace current]::decodeHtml $value]] output}if {(![info exists feed(remove-empty)]) || ($feed(remove-empty) == 1)} {regsub -nocase -all -- "@@.*?@@" $output "" output}if {([info exists feed(eval-tcl)]) &amp;&amp; ($feed(eval-tcl) == 1)} {if {[catch {set output [subst $output]} error] != 0} {putlog "\002RSS Error\002: $error"}}return $output}proc ::rss-synd::channelCheck {chanlist chan} {foreach match [split $chanlist] {if {[string match -nocase $match $chan]} { return 1 }}return 0}proc ::rss-synd::decodeHtml {data} {array set chars { nbsp\x20 amp\x26 quot\x22 lt\x3C gt\x3E iexcl\xA1 cent\xA2 pound\xA3 curren\xA4 yen\xA5 brvbar\xA6 brkbar\xA6 sect\xA7 uml\xA8 die\xA8 copy\xA9 ordf\xAA laquo\xAB not\xAC shy\xAD reg\xAE hibar\xAF macr\xAF deg\xB0 plusmn\xB1 sup2\xB2 sup3\xB3 acute\xB4 micro\xB5 para\xB6 middot\xB7 cedil\xB8 sup1\xB9 ordm\xBA raquo\xBB frac14\xBC frac12\xBD frac34\xBE iquest\xBF Agrave\xC0 Aacute\xC1 Acirc\xC2 Atilde\xC3 Auml\xC4 Aring\xC5 AElig\xC6 Ccedil\xC7 Egrave\xC8 Eacute\xC9 Ecirc\xCA Euml\xCB Igrave\xCC Iacute\xCD Icirc\xCE Iuml\xCF ETH\xD0 Dstrok\xD0 Ntilde\xD1 Ograve\xD2 Oacute\xD3 Ocirc\xD4 Otilde\xD5 Ouml\xD6 times\xD7 Oslash\xD8 Ugrave\xD9 Uacute\xDA Ucirc\xDB Uuml\xDC Yacute\xDD THORN\xDE szlig\xDF agrave\xE0 aacute\xE1 acirc\xE2 atilde\xE3 auml\xE4 aring\xE5 aelig\xE6 ccedil\xE7 egrave\xE8 eacute\xE9 ecirc\xEA euml\xEB igrave\xEC iacute\xED icirc\xEE iuml\xEF eth\xF0 ntilde\xF1 ograve\xF2 oacute\xF3 ocirc\xF4 otilde\xF5 ouml\xF6 divide\xF7 oslash\xF8 ugrave\xF9 uacute\xFA ucirc\xFB uuml\xFC yacute\xFD thorn\xFE yuml\xFF ensp\x20 emsp\x20 thinsp\x20 zwnj\x20 zwj\x20 lrm\x20 rlm\x20 euro\x80 sbquo\x82 bdquo\x84 hellip\x85 dagger\x86 Dagger\x87 circ\x88 permil\x89 Scaron\x8A lsaquo\x8B OElig\x8C oelig\x8D lsquo\x91 rsquo\x92 ldquo\x93 rdquo\x94 ndash\x96 mdash\x97 tilde\x98 scaron\x9A rsaquo\x9B Yuml\x9F}regsub -all -- {([\"\$\[\]\{\}\(\)\\])} $data {\\\1} dataregsub -all -- {&amp;#([0-9][0-9]?[0-9]?);?} $data {[format %c [scan \1 %d]]} dataregsub -all -- {&amp;([0-9a-z#]*);} $data {$chars(\1)} dataregsub -all -nocase -- {&amp;([0-9a-z#]*);} $data {[string tolower \1]} datareturn [subst $data]}proc ::rss-synd::splitData {data count} {set results [regexp -inline -all -- {&lt;(.*?)&gt;(.*?)&lt;/\1&gt;} $data]set length [expr { [llength $results] - 1 }]if {$length &lt; 1} { return 1 }for {set i $length} {$i &gt;= 0} {set i [expr { $i - 1 }]} {if {[expr { $i % $count }] == 0} {set results [lreplace $results $i $i]}}return $results}::rss-synd::init</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7600">fauves</a> — Tue Aug 01, 2006 3:57 am</p><hr />
]]></content>
	</entry>
	</feed>
