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

	<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>2011-11-28T05:10:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[vladdeh]]></name></author>
		<updated>2011-11-28T05:10:29-04:00</updated>

		<published>2011-11-28T05:10:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98269#p98269</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98269#p98269"/>
		<title type="html"><![CDATA[youtube script don't want it to work globally]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98269#p98269"><![CDATA[
Sorry, this wasn't even the section I wanted to post in, my apologies.<br><br>BTW it worked, thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11622">vladdeh</a> — Mon Nov 28, 2011 5:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2011-11-28T04:51:59-04:00</updated>

		<published>2011-11-28T04:51:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98267#p98267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98267#p98267"/>
		<title type="html"><![CDATA[youtube script don't want it to work globally]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98267#p98267"><![CDATA[
Why did you start new topic? There is  <a href="http://forum.egghelp.org/viewtopic.php?t=17168" class="postlink">http://forum.egghelp.org/viewtopic.php?t=17168</a> with my answer to you with this script. <br>Replace<div class="codebox"><p>Code: </p><pre><code>proc bind pubm - * ::etube::etube     proc ::etube::petube {nick uhost hand text} {         if {![channel get $chan etube]} {             return 0         }         ::etube::etube $nick $uhost $hand $nick $text     } </code></pre></div> with <div class="codebox"><p>Code: </p><pre><code>bind pubm - * ::etube::petube     proc ::etube::petube {nick uhost hand chan text} {         if {![channel get $chan etube]} {             return 0         }         ::etube::etube $nick $uhost $hand $chan $text     } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Mon Nov 28, 2011 4:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[vladdeh]]></name></author>
		<updated>2011-11-28T04:38:49-04:00</updated>

		<published>2011-11-28T04:38:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98266#p98266</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98266#p98266"/>
		<title type="html"><![CDATA[youtube script don't want it to work globally]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98266#p98266"><![CDATA[
So this script takes youtube links said on channel then replies with the title etc. but right now it does it on every channel the bot is on, I only want it to do it on the channels that I want it in, not in all, help me please?<br><div class="codebox"><p>Code: </p><pre><code>namespace eval etube {foreach p [array names etube *] { catch {unset etube($p) } }setudef flag etube    variable etube    array set etube {    ignored "wordtoignore1 wordtoignore2"    delay 10    outtype 3    bestcomment 1    strlength 500    color1 \00314    color2 \00303    color3 \00305    version "etube.tcl version 1.0"    author "tvrsh"    }    package require http 2.7      bind pubm - * ::etube::etube    proc ::etube::petube {nick uhost hand text} {        if {![channel get $chan etube]} {             return 0        }        ::etube::etube $nick $uhost $hand $nick $text    }    bind msgm - * ::etube::metube    proc ::etube::metube {nick uhost hand text} {        ::etube::etube $nick $uhost $hand $nick $text    }    proc ::etube::etube {nick uhost hand chan text} {        variable etube        if {[info exists etube(lasttime,$chan)] &amp;&amp; [expr $etube(lasttime,$chan) + $etube(delay)] &gt; [clock seconds]} {            return 0        }        set etube(start) [clock clicks]        regsub -all -- {\017|\002|\037|\026|\003(\d{1,2})?(,\d{1,2})?} $text "" text        set url [lsearch -inline [split $text] *http://*youtube*watch*]        if {$url == ""} {return 0}        ::http::config -useragent "Yandex/1.01.001 (compatible; Win16; I)"        set yt_tok [::http::geturl "$url" -timeout 20000]          set data [::http::data $yt_tok]        ::http::cleanup $yt_tok        putlog "\[etube\] $nick/$chan"        regsub -all -- {\n} $data " " data        set data [encoding convertto cp1251 [encoding convertfrom utf-8 $data]]        set errormsg ""        regexp -- {&lt;div id="watch-player-unavailable-message-container"&gt;(.+?)&lt;/div&gt;} $data - errormsg        if {$errormsg != ""} {            ::etube::largetext PRIVMSG $chan "\002$nick\002, $errormsg\003"            set etube(lasttime,$chan) [clock seconds]            return 0        }        set verifymsg ""        regexp -- {&lt;div id="verify-details"&gt;(.+?)&lt;/div&gt;} $data - verifymsg        if {$verifymsg != ""} {            ::etube::largetext PRIVMSG $chan "\002$nick\002, $verifymsg\003"            set etube(lasttime,$chan) [clock seconds]            return 0        }        set title ""        regexp {&lt;span id="eow-title" .*? title="(.*?)"} $data "" title        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" title        set title [string trim $title]        foreach ignword [split $etube(ignored)] {            if {[string match -nocase *$ignword* $title]} {                ::etube::largetext PRIVMSG $chan "\002$nick\002, title of this video contein forbidden words. You fail!"                set etube(lasttime,$chan) [clock seconds]                return 0            }        }        set length "100"        regexp {"length_seconds": (.*?),} $data "" length        set views ""        regexp {&lt;span class="watch-view-count"&gt;(.*?)&lt;/span&gt;} $data "" views        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $views "" views        set views [string trim $views]        set author ""        regexp {&lt;div id="watch-headline-user-info"&gt;(.*?)&lt;/a&gt;} $data "" author        regexp {title="(.*?)"} $author "" author        regexp {&lt;strong&gt;(.*?)&lt;/strong&gt;} $author "" author        set date ""        regexp {&lt;span id="eow-date" class="watch-video-date" &gt;(.*?)&lt;/span&gt;} $data "" date        set date [string trim $date]        set desc ""        regexp {&lt;p id="eow-description" &gt;(.*?)&lt;/p&gt;} $data "" desc        regsub -all -- {&lt;br /&gt;} $desc " " desc        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $desc "" desc        set category ""        regexp {&lt;p id="eow-category"&gt;(.*?)&lt;/p&gt;} $data "" category        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $category "" category        set tags ""        regexp {&lt;ul id="eow-tags" class="watch-info-tag-list"&gt;(.*?)&lt;/ul&gt;} $data "" tags        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $tags "" tags        set tags [join $tags ", "]        set comments ""; set comment ""; set cauthor ""; set cdate ""        regexp {&lt;ul class="comment-list" &gt;(.*?)&lt;/li&gt;} $data "" comments        regexp {&lt;div class="comment-text" dir="ltr"&gt;(.*?)&lt;/p&gt;} $comments "" comment        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $comment "" comment        set comment "$etube(color1)Last comment: $etube(color3)[string trim $comment]"        regexp {&lt;a class="author".*?&gt;(.*?)&lt;/a&gt;} $comments "" cauthor        regexp {&lt;span class="time"&gt;(.*?)&lt;/span&gt;} $comments "" cdate        if {$etube(bestcomment) == "1"} {            regexp {&lt;h4&gt;Ëó÷øèå.*?&lt;li class="comment "(.*?)&lt;/li&gt;} $data "" comments            regexp {&lt;div class="comment-text" dir="ltr"&gt;(.*?)&lt;/div&gt;} $comments "" comment            regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $comment "" comment            set comment "$etube(color1)Top comment: $etube(color3)[string trim $comment]"            regexp {&lt;a class="author ".*?&gt;(.*?)&lt;/a&gt;} $comments "" cauthor            regexp {&lt;span class="time"&gt;(.*?)&lt;/span&gt;} $comments "" cdate        }         set likes ""; set dislikes ""        regexp {&lt;span class="likes"&gt;(.*?)&lt;/span&gt;} $data "" likes        regexp {&lt;span class="dislikes"&gt;(.*?)&lt;/span&gt;} $data "" dislikes        set outstring1 "[string range "Video title: $title. Category: $category. Views: $views. Likes/Dislikes: $likes/$dislikes." 0 $etube(strlength)]"        set outstring2 "[string range "$etube(color1)$desc\003" 0 $etube(strlength)]"        set outstring3 "[string range "$comment $etube(color1)by $etube(color3)$cauthor$etube(color1)($etube(color3)$cdate$etube(color1)). \00315([expr ([clock clicks] - $etube(start))/1000.0]ms.)\003" 0 $etube(strlength)]"        switch $etube(outtype) {            1 {            ::etube::largetext PRIVMSG $chan $outstring1            }            2 {            ::etube::largetext PRIVMSG $chan $outstring1            ::etube::largetext PRIVMSG $chan $outstring1            }            3 {            ::etube::largetext PRIVMSG $chan $outstring1            ::etube::largetext PRIVMSG $chan $outstring1            ::etube::largetext PRIVMSG $chan $outstring1            }        }        set etube(lasttime,$chan) [clock seconds]        return 0    }    proc ::etube::largetext {type target text {delims {" "•,.!?}}} {        set lineLen [expr 512 - [string length ":$::botname $type [join $target] :\r\n"]]        if {[string length $text] &lt;= $lineLen} {             putserv "$type $target :[::etube::strip.html $text]"            return 0        }        set _text [split $text $delims]        set x 0        set i 0        while {$x &lt; $lineLen} {            if {$i &gt;= [llength $_text]} {                 return 0            }            set wordlen [string length [lindex $_text $i]]            if {$x + $wordlen &gt; $lineLen} {                 break            }            incr x $wordlen            incr x            incr i        }    putserv "$type $target :[::etube::strip.html [string range $text 0 [expr $x - 1]]]"    set color [string range [lindex [split [string range $text 0 [expr $x - 1]] "\003"] [expr [llength [split [string range $text 0 [expr $x - 1]] "\003"]] - 1]] 0 1]    if {![isnumber $color]} {set color ""}    ::etube::largetext $type $target \003$color[string trimleft [string range $text $x end]] $delims    }    # (c) feed.tcl by Vertigo    proc ::etube::strip.html {t} {        regsub -all -nocase -- {&lt;.*?&gt;(.*?)&lt;/.*?&gt;} $t {\1} t        regsub -all -nocase -- {&lt;.*?&gt;} $t {} t        set t [string map {{&amp;} {&amp;}} $t]        set t [string map -nocase {{—} {-} {»} {»} {«} {«} {"} {"}  \{&lt;} {&lt;} {&gt;} {&gt;} { } { } {&amp;} {&amp;} {©} {©} {©} {©} {•} {•} {·} {-} {§} {§} {®} {®} \  ‖ || \&amp;      &amp;     [      (     \      /     ]      )      {     (     }     ) \£     £     ¨     ¨     ©     ©     «     «      ­     ­     ®     ® \¡     ¡     ¿     ¿     ´     ´     ·     ·      ¹     ¹     »     » \¼     ¼     ½     ½     ¾     ¾     À     À      Á     Á     Â     Â \Ã     Ã     Ä     Ä     Å     Å     Æ     Æ      Ç     Ç     È     È \É     É     Ê     Ê     Ë     Ë     Ì     Ì      Í     Í     Î     Î \Ï     Ï     Ð     Ð     Ñ     Ñ     Ò     Ò      Ó     Ó     Ô     Ô \Õ     Õ     Ö     Ö     ×     ×     Ø     Ø      Ù     Ù     Ú     Ú \Û     Û     Ü     Ü     Ý     Ý     Þ     Þ      ß     ß     à     à \á     á     â     â     ã     ã     ä     ä      å     å     æ     æ \ç     ç     è     è     é     é     ê     ê      ë     ë     ì     ì \í     í     î     î     ï     ï     ð     ð      ñ     ñ     ò     ò \ó     ó     ô     ô     õ     õ     ö     ö      ÷     ÷     ø     ø \ù     ù     ú     ú     û     û     ü     ü      ý     ý     þ     þ \°     °     ‧    ·     ˌ     .     ū     u      ī     i     ˈ     ' \ɔ     o     ɪ     i     &amp;apos;     ' } $t]set t [string map -nocase {¡    \xA1  ¤   \xA4  ¢     \xA2  £    \xA3   ¥      \xA5  ¦   \xA6 \§     \xA7  ¨      \xA8  ©     \xA9  ª     \xAA   «    \xAB  ¬      \xAC \­      \xAD  ®      \xAE  ¯     \xAF  °      \xB0   ±   \xB1  ²     \xB2 \³     \xB3  ´    \xB4  µ    \xB5  ¶     \xB6   ·   \xB7  ¸    \xB8 \¹     \xB9  º     \xBA  »    \xBB  ¼   \xBC   ½   \xBD  ¾   \xBE \¿   \xBF  ×    \xD7  ÷   \xF7  À   \xC0   Á   \xC1  Â    \xC2 \Ã   \xC3  Ä     \xC4  Å    \xC5  Æ    \xC6   Ç   \xC7  È   \xC8 \É   \xC9  Ê    \xCA  Ë     \xCB  Ì   \xCC   Í   \xCD  Î    \xCE \Ï     \xCF  Ð      \xD0  Ñ   \xD1  Ò   \xD2   Ó   \xD3  Ô    \xD4 \Õ   \xD5  Ö     \xD6  Ø   \xD8  Ù   \xD9   Ú   \xDA  Û    \xDB \Ü     \xDC  Ý   \xDD  Þ    \xDE  ß    \xDF   à   \xE0  á   \xE1 \â    \xE2  ã   \xE3  ä     \xE4  å    \xE5   æ    \xE6  ç   \xE7 \è   \xE8  é   \xE9  ê    \xEA  ë     \xEB   ì   \xEC  í   \xED \î    \xEE  ï     \xEF  ð      \xF0  ñ   \xF1   ò   \xF2  ó   \xF3 \ô    \xF4  õ   \xF5  ö     \xF6  ø   \xF8   ù   \xF9  ú   \xFA \û    \xFB  ü     \xFC  ý   \xFD  þ    \xFE   ÿ     \xFF} $t]        set t [[namespace current]::regsub-eval {&amp;#([0-9]{1,5});} $t {string trimleft \1 "0"}]        regsub -all {[\x20\x09]+} $t " " t        regsub -all -nocase -- {&lt;.*?&gt;} $t {} t        return $t    }    proc ::etube::regsub-eval {re string cmd} {        return [subst [regsub -all $re [string map {\[ \\[ \] \\] \$ \\$ \\ \\\\} $string] "\[format %c \[$cmd\]\]"]]    }    proc ::etube::duration {s} {        variable etube        set minutes [expr {$s / 60}]  set seconds [expr {$s % 60}]  set res ""        if {$minutes != 0} {            lappend res "$etube(color3)$minutes$etube(color1):"        }  if {$seconds != 0} {            lappend res "$etube(color3)$seconds"        }  return [string map {": " ":"} $res]    }    putlog "\[etube\] $etube(version) by $etube(author) loaded"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11622">vladdeh</a> — Mon Nov 28, 2011 4:38 am</p><hr />
]]></content>
	</entry>
	</feed>
