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

	<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>2008-09-17T06:48:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2008-09-17T06:48:05-04:00</updated>

		<published>2008-09-17T06:48:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85190#p85190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85190#p85190"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85190#p85190"><![CDATA[
<blockquote class="uncited"><div>I've tried another one, with the url that you gave me...<br><br><br>### Configuration settings ###<br><br># the triggers: [seperate with spaces]<br>set google(triggers) "!legendas"<br><br># flags needed to use the trigger [default=everyone]<br>set google(flags) "-|-"<br><br># channels where the bot doesn't respond to triggers [seperate with spaces]<br>set google(nopub) ""<br><br># flood protection: seconds between use of the triggers<br># to disable: set it to 0<br>set google(antiflood) 5<br><br># method to send the messages:<br># 0 = Private message<br># 1 = Public message<br># 2 = Private notice<br># 3 = Public notice<br>set google(method) 1<br><br># show how many results? 1, 2 or 3??<br>set google(results) 3<br><br># show every result on a new line? 0=no 1=yes<br>set google(perline) 0<br><br>set google(version) 0.4<br><br>if {[catch { package require http } err]} {<br>putlog "Cannot load [file tail [info script]]: Problem loading the http package: $err"<br>return 1<br>}<br><br>if {[info tclversion] &lt; 8.1} {<br>putlog "Cannot load [file tail [info script]]: You need at least Tcl version 8.1 and you have Tcl version [info tclversion]."<br>return 1<br>}<br><br>foreach trigger [split $google(triggers)] {<br>bind pub $google(flags) $trigger google:pub<br>}<br>catch { unset trigger }<br><br>proc google:output {chan nick output} {<br>global google<br><br>switch $google(method) {<br>0 { putquick "PRIVMSG $nick :$output" }<br>1 { putquick "PRIVMSG $chan :$output" }<br>2 { putquick "NOTICE $nick :$output" }<br>3 { putquick "NOTICE $chan :$output" }<br>default { putquick "PRIVMSG $chan :$output" }<br>}<br>}<br><br>proc google:pub {nick uhost hand chan text} {<br>global lastbind google<br><br>if {[lsearch -exact $google(nopub) [string tolower $chan]] &gt;= 0} { return 0 }<br><br>if {[string length [string trim [lindex $text 0]]] == 0} {<br>putquick "NOTICE $nick :Usage: $lastbind &lt;keywords&gt;"<br>return 0<br>}<br><br>if {[info exists google(floodprot)]} {<br>set diff [expr [clock seconds] - $google(floodprot)]<br>if {$diff &lt; $google(antiflood)} {<br>putquick "NOTICE $nick :Trigger has just been used! Please wait [expr $google(antiflood) - $diff] seconds..."<br>return 0<br>}<br>catch { unset diff }<br>}<br>set google(floodprot) [clock seconds]<br><br>regsub -all { } [join $text] {+} search<br>set google(url) "<a href="http://www.legendasxvid.net/modules.php?name=Downloads&amp;d_op=search&amp;min=0&amp;query=%25%25query%25%25&amp;orderby=dateD" class="postlink">http://www.legendasxvid.net/modules.php ... erby=dateD</a>"<br>set google(page) [http::config -useragent "Mozilla"]<br>if {[catch {set google(page) [http::geturl $google(url) -timeout 15000]} msg]} {<br>putquick "NOTICE $nick :Can't connect ($msg)"<br>return 0<br>}<br>set google(data) [http::data $google(page)]<br><br>if {$google(results) &gt;= 1} {<br>regexp -nocase {related:(.*?)&gt;} $google(data) t link1<br>}<br>if {$google(results) &gt;= 2} {<br>regexp -nocase {related:.*?&gt;.*?related:(.*?)&gt;} $google(data) t link2<br>}<br>if {$google(results) &gt;= 3} {<br>regexp -nocase {related:.*?&gt;.*?related:.*?&gt;.*?related:(.*?)&gt;} $google(data) t link3<br>}<br><br>if {$google(perline) == 1} {<br>set separator "\n"<br>} else {<br>set separator "-"<br>}<br><br>if {[info exists link3]} {<br>set output "http://$link1 $separator http://$link2 $separator http://$link3"<br>} elseif {[info exists link2]} {<br>set output "http://$link1 $separator http://$link2"<br>} elseif {[info exists link1]} {<br>set output "http://$link1"<br>} else {<br>set output "Nothing found." &lt;------------------------------------ THIS PART HERE<br>}<br><br>regsub -all {%26} $output {\&amp;} output<br>regsub -all {%3F} $output {?} output<br>regsub -all {%3D} $output {=} output<br><br>if {$google(perline) == 1} {<br>foreach line [split $output \n] {<br>google:output $chan $nick [string trim $line]<br>}<br>} else {<br>google:output $chan $nick [string trim $output]<br>}<br><br>catch { unset output separator t link1 link2 link3 }<br>catch { http::cleanup $google(page) }<br><br>return 0<br>}<br><br>putlog "Google script $google(version) loaded!" </div></blockquote>On the irc, it shows: Nothing found.<br>even if i change that part, i have no ideia what to put there.<br>Where i have " &lt;------------  THIS PART HERE " if i don't edit that, it will show me on the IRC, what a wrote there, i think that now, the only problem is on the " set output ".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Wed Sep 17, 2008 6:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2008-09-16T20:48:50-04:00</updated>

		<published>2008-09-16T20:48:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85188#p85188</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85188#p85188"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85188#p85188"><![CDATA[
I've tried another one, with the url that you gave me...<br><br><br>### Configuration settings ###<br><br># the triggers: [seperate with spaces]<br>set google(triggers) "!legendas"<br><br># flags needed to use the trigger [default=everyone]<br>set google(flags) "-|-"<br><br># channels where the bot doesn't respond to triggers [seperate with spaces]<br>set google(nopub) ""<br><br># flood protection: seconds between use of the triggers<br># to disable: set it to 0<br>set google(antiflood) 5<br><br># method to send the messages:<br># 0 = Private message<br># 1 = Public message<br># 2 = Private notice<br># 3 = Public notice<br>set google(method) 1<br><br># show how many results? 1, 2 or 3??<br>set google(results) 3<br><br># show every result on a new line? 0=no 1=yes<br>set google(perline) 0<br><br>set google(version) 0.4<br><br>if {[catch { package require http } err]} {<br>putlog "Cannot load [file tail [info script]]: Problem loading the http package: $err"<br>return 1<br>}<br><br>if {[info tclversion] &lt; 8.1} {<br>putlog "Cannot load [file tail [info script]]: You need at least Tcl version 8.1 and you have Tcl version [info tclversion]."<br>return 1<br>}<br><br>foreach trigger [split $google(triggers)] {<br>bind pub $google(flags) $trigger google:pub<br>}<br>catch { unset trigger }<br><br>proc google:output {chan nick output} {<br>global google<br><br>switch $google(method) {<br>0 { putquick "PRIVMSG $nick :$output" }<br>1 { putquick "PRIVMSG $chan :$output" }<br>2 { putquick "NOTICE $nick :$output" }<br>3 { putquick "NOTICE $chan :$output" }<br>default { putquick "PRIVMSG $chan :$output" }<br>}<br>}<br><br>proc google:pub {nick uhost hand chan text} {<br>global lastbind google<br><br>if {[lsearch -exact $google(nopub) [string tolower $chan]] &gt;= 0} { return 0 }<br><br>if {[string length [string trim [lindex $text 0]]] == 0} {<br>putquick "NOTICE $nick :Usage: $lastbind &lt;keywords&gt;"<br>return 0<br>}<br><br>if {[info exists google(floodprot)]} {<br>set diff [expr [clock seconds] - $google(floodprot)]<br>if {$diff &lt; $google(antiflood)} {<br>putquick "NOTICE $nick :Trigger has just been used! Please wait [expr $google(antiflood) - $diff] seconds..."<br>return 0<br>}<br>catch { unset diff }<br>}<br>set google(floodprot) [clock seconds]<br><br>regsub -all { } [join $text] {+} search<br>set google(url) "<a href="http://www.legendasxvid.net/modules.php?name=Downloads&amp;d_op=search&amp;min=0&amp;query=%25%25query%25%25&amp;orderby=dateD" class="postlink">http://www.legendasxvid.net/modules.php ... erby=dateD</a>"<br>set google(page) [http::config -useragent "Mozilla"]<br>if {[catch {set google(page) [http::geturl $google(url) -timeout 15000]} msg]} {<br>putquick "NOTICE $nick :Can't connect ($msg)"<br>return 0<br>}<br>set google(data) [http::data $google(page)]<br><br>if {$google(results) &gt;= 1} {<br>regexp -nocase {related:(.*?)&gt;} $google(data) t link1<br>}<br>if {$google(results) &gt;= 2} {<br>regexp -nocase {related:.*?&gt;.*?related:(.*?)&gt;} $google(data) t link2<br>}<br>if {$google(results) &gt;= 3} {<br>regexp -nocase {related:.*?&gt;.*?related:.*?&gt;.*?related:(.*?)&gt;} $google(data) t link3<br>}<br><br>if {$google(perline) == 1} {<br>set separator "\n"<br>} else {<br>set separator "-"<br>}<br><br>if {[info exists link3]} {<br>set output "http://$link1 $separator http://$link2 $separator http://$link3"<br>} elseif {[info exists link2]} {<br>set output "http://$link1 $separator http://$link2"<br>} elseif {[info exists link1]} {<br>set output "http://$link1"<br>} else {<br>set output "Nothing found." &lt;------------------------------------<br>}<br><br>regsub -all {%26} $output {\&amp;} output<br>regsub -all {%3F} $output {?} output<br>regsub -all {%3D} $output {=} output<br><br>if {$google(perline) == 1} {<br>foreach line [split $output \n] {<br>google:output $chan $nick [string trim $line]<br>}<br>} else {<br>google:output $chan $nick [string trim $output]<br>}<br><br>catch { unset output separator t link1 link2 link3 }<br>catch { http::cleanup $google(page) }<br><br>return 0<br>}<br><br>putlog "Google script $google(version) loaded!" <br><br><br>On the irc, it shows: Nothing found.<br>even if i change that part, i have no ideia what to put there.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Tue Sep 16, 2008 8:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2008-09-16T20:02:13-04:00</updated>

		<published>2008-09-16T20:02:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85187#p85187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85187#p85187"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85187#p85187"><![CDATA[
I even tried to use the normal google tcl, only changing the url, but it doesn't work.<br><br>Can you please help me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Tue Sep 16, 2008 8:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2008-09-09T05:13:44-04:00</updated>

		<published>2008-09-09T05:13:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85100#p85100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85100#p85100"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85100#p85100"><![CDATA[
Thank's for the help, but i have no idea what's wrong, now with the url that you gave me, stills doesn't work.<br><br>I'm looking at the code, and i cant find the error.<br><br>If it isn't asking too much, could you kindly help me with the code?<br>Maybe a different one or something.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Tue Sep 09, 2008 5:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-09-08T20:30:54-04:00</updated>

		<published>2008-09-08T20:30:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85097#p85097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85097#p85097"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85097#p85097"><![CDATA[
Your building the url incorrectly.<div class="codebox"><p>Code: </p><pre><code>Change:set legendas(url) "http://www.legendasxvid.net/modules.php?name=Downloads&amp;d_op=search&amp;min=0&amp;query={ }&amp;orderby=dateD" To:set legendas(url) "http://www.legendasxvid.net/modules.php?name=Downloads&amp;d_op=search&amp;min=0&amp;query=%%query%%&amp;orderby=dateD"Change:set url [append legendas(url) [string map {\ +} $arg]] To:set url $legendas(url)regsub {%%query%%} $url "[string map {" " "+"} $arg]" url</code></pre></div>That should fix it for the most part, assuming your parsing is correct.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Sep 08, 2008 8:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2008-09-12T12:27:19-04:00</updated>

		<published>2008-09-08T08:18:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85087#p85087</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85087#p85087"/>
		<title type="html"><![CDATA[Help with tcl, to search subtitles in 1 site]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85087#p85087"><![CDATA[
Hi, i'm trying to make a TCL that searches one website for subtitles, and then give me the link in the irc, but i can't get it to work...<br>I've been searching here, and in google, and i can't find anything like the one that i want.<br><br>I want the tcl to search this site: <a href="http://www.legendasdivx.com" class="postlink">http://www.legendasdivx.com</a><br>I think the search link is this one,<br><a href="http://www.legendasdivx.com/modules.php?name=Downloads&amp;file=jz&amp;d_op=search&amp;op=_jz00" class="postlink">http://www.legendasdivx.com/modules.php ... h&amp;op=_jz00</a><br><br>It's a Portuguese website.<br><br>CODE:<br><blockquote class="uncited"><div>set legendas(cmd) "!legendas"<br>set legendas(help) "\002!legendas\002 \&lt;Filme&gt;"<br>set legendas(url) "<a href="http://www.legendasxvid.net/modules.php?name=Downloads&amp;d_op=search&amp;min=0&amp;query=" class="postlink">http://www.legendasxvid.net/modules.php ... n=0&amp;query=</a>{ }&amp;orderby=dateD"<br>setudef flag legendas<br><br>bind pub - $legendas(cmd) legendas:request<br><br>package require http<br>http::config -useragent "Mozilla/1.0"<br><br>proc legendas:request { nick uhost hand chan arg } {<br>if { [ lsearch -exact [ channel info $chan ] "+legendas" ] == -1 } { return }<br><br>global legendas<br>if {[string match -nocase $arg "help"] || [lindex $arg 0 ] == ""} {<br>putquick "privmsg $chan :$legendas(help)"<br>return<br>}<br>putlog "\002LEGENDAS\002: !legendas $arg -&gt; $nick@$chan "<br><br>set url [append legendas(url) [string map {\  +} $arg]]<br>putlog "\002URL\002: $url"<br><br>set http [ http::geturl $url ]<br>set html [ http::data $http ]<br>set num 1<br><br>foreach line [ split $html "\n" ] {<br>if { [ regexp -- {^.*&lt;br&gt;&lt;font color\=#008000&gt;(.+).*&lt;/font&gt;&lt;a class.*$} $line all link ] } {<br>if { $num &gt; 4 } { break} <br>incr num<br>regsub -all -- { -.*-\s*$} $link "" link<br>set risposta "$answer\002::\002 $link "<br>}<br>}<br>regsub -all -- {\s+} $answer " " answer<br>putquick "privmsg $chan :\037Legendas\037: $answer"<br>}</div></blockquote>I appreciate the help, 'cos i really want this to work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Mon Sep 08, 2008 8:18 am</p><hr />
]]></content>
	</entry>
	</feed>
