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

	<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>2014-03-08T03:19:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[bunnybump]]></name></author>
		<updated>2014-03-08T03:19:58-04:00</updated>

		<published>2014-03-08T03:19:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102663#p102663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102663#p102663"/>
		<title type="html"><![CDATA[KEEP IN FAILED]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102663#p102663"><![CDATA[
i dunno how could you made this script works. i've try it so many times but it keeps FAILED. how can i use your script for my eggdrop? what command that i have to use so i can use it as what you said?<br><br>please check the screenshot below (<span style="color:blue">and probably you would be happy to made a test with your own script right before post it in here</span>):<br><blockquote class="uncited"><div><img src="http://i.imgur.com/dzt3XXh.jpg" class="postimage" alt="Image"></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12060">bunnybump</a> — Sat Mar 08, 2014 3:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-03-04T15:28:50-04:00</updated>

		<published>2014-03-04T15:28:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102654#p102654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102654#p102654"/>
		<title type="html"><![CDATA[new version of code - in namespace...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102654#p102654"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>namespace eval ourtubeXTRA {setudef flag ourtubeXTRAglobal tcl_platform #What language you can receive the youTube data? (if works heh)set lang en#youtube logoset youtubelogo "\002\00304,00You\00300,04Tube\017"        set outputline "$youtubelogo \00311:: \002\00309&lt;title&gt; \002\00311:: \00308Author: \00314&lt;author&gt; \700311:: \00308Added: \00314&lt;added&gt; \00311:: \00308Views: \00314&lt;views&gt; \00311:: \00308Duration: \00314&lt;duration&gt; \00311:: \00308Likes: \00309&lt;likes&gt; \00311:: \00308Dislikes: \00304&lt;dislikes&gt; \00311::\002\00312 &lt;badgelist&gt; \017\00314&lt;full_description&gt;\n"          set outputsearch " \00308&lt;vcount&gt;. \00312\037&lt;link&gt;\003\037 \00311:: \00309&lt;title&gt; \00311:: \00308Author: \00314&lt;author&gt; \00311:: \00308Added: \00314&lt;added&gt; \00311::  \00308Views: \00314&lt;views&gt; \00311:: \00308Duration: \00314&lt;duration&gt; \00311: \002\00312 &lt;badgelist&gt;\017\00314&lt;description&gt;"          set author "WazzaUK"set contact "WazzaUK &lt;wallison_uk@yahoo.co.uk&gt;"set originalauthor "HackeMate"set originalcontact "HackeMate &lt;Sentencia@eggdrop.es&gt;"set name "ourtubeXTRA"set projectName "ourtubeXTRA"set package.http [package require http]set protection ""set ytrest 10     set max_links 5if {$tcl_platform(os) eq "Linux"} {set platfrm "X11"} else {set platfrm $tcl_platform(os)}http::config -useragent "Mozilla/5.0 ($platfrm; U; $tcl_platform(os) $tcl_platform(machine); $lang; rv:1.9.0.3) ourtubeXTRA 1.0" -accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"     bind pubm - *http://www.youtube.com/watch?* ourtubeXTRA::otPubbind pub - !youtube ourtubeXTRA::otYoutubeproc create_badgelist {badges} {set badgelist ""if { [string length $badges] &gt; 1} {foreach badge [split $badges] {if { $badge ne " " } {append badgelist "\[$badge\] "}}}return $badgelist}proc parse_text {maxlen text} {set newtext ""set ccount 0set linelist ""foreach word [split $text] {set prednum [ expr {([string length $word] + $ccount) + 1}]if {$prednum &gt;= $maxlen} {set ccount 0lappend linelist $newtextset newtext ""} else {append newtext $word " "incr ccount}set ccount [ expr {[string length $word] + $ccount}]}if {$ccount &gt;0} {lappend linelist $newtext }return $linelist}proc url_search {maxlen color styles text} {set i 0set newtext ""set style_ul ""set style_bd ""  if {![string is integer -strict $maxlen]} {set maxlen [ string length $text ] }        if {($maxlen == "") || ($maxlen &lt; 1)} {set maxlen [ string length $text ]}if {![string is alpha -strict $styles]} {set styles "style_ul"}if {[string match -nocase style_ul $styles]} {set style_ul "\037"}if {[string match -nocase style_bd $styles]} {set style_bd "\002"}if {![string is integer -strict $color]} {set color "07"}        if {($color &lt; 0) || ($color &gt; 15)} {set color 07}foreach word [split $text] {set urlindex -1set isurl 0        if {[string length $word] &gt;= 5 &amp;&amp; [regexp {(f|ht)tp(s|)://} $word] &amp;&amp; ![regexp {://([^/:]*:([^/]*@|\d+(/|$))|.*/\.)} $word]} {set wprotocol ""set isurl 1regexp {(f|ht)tp(s|)://} $word "" wprotocolset urlindex [string first $wprotocol $word 0]set newword [string range $word $urlindex [string length $word]]set oldlen [expr [string first $wprotocol $word 0] -1 ]set oldword [string range $word 0 $oldlen]             incr iif { $urlindex &gt; 0 } { append oldword " " }     set word "$oldword\003${color}${style_bd}${style_ul}$newword\00314${style_bd}${style_ul}"}append newtext $word " "}return $newtext}proc utfdecodeclean {string} {regsub -all -- {([\(\)\[\]\{\}\$\"\\])} $string {\\\1} string        return $string}proc utfdecode {content} {if {![regexp -- &amp; $content]} {return $content}set escapes {  \xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4¥ \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 À \xc0 Á \xc1 Â \xc2Ã \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xccÍ \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6× \xd7 Ø \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 ÷ \xf7 ø \xf8 ù \xf9ú \xfa û \xfb ü \xfc ý \xfd þ \xfeÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39EΟ \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BAλ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BFπ \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F∑ \u2211 − \u2212 ∗ \u2217 √ \u221A∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A⌋ \u230B 〈 \u2329 〉 \u232A ◊ \u25CA♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666" \x22 &amp; \x26 &lt; \x3C &gt; \x3E O&amp;Elig; \u152 œ \u153Š \u160 š \u161 Ÿ \u178 ˆ \u2C6˜ \u2DC   \u2002   \u2003   \u2009‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A“ \u201C ” \u201D „ \u201E † \u2020‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A€ \u20AC &amp;apos; \u0027 ‎ "" ‏ "" ‬ "" ‭ ""‮ "" — \u2014}set content [string map $escapes $content]     regsub -all -- {&amp;[a-zA-Z]+?;} [utfdecodeclean $content] {?} content     regsub -all -- {&amp;#(\d{1,3});} $content {[format %c [scan \1 %d]]} content     return [subst $content]}proc otYoutube {nick uhost hand chan text} {if {![channel get $chan ourtubeXTRA]} {        if {$text eq "enable"} {                channel set $chan +ourtubeXTRA                        return               } else {putquick "NOTICE $nick :${ourtubeXTRA::youtubelogo} \00311:: \00315$chan has this command disabled."}if {[matchattr $hand n]} {putquick "NOTICE $nick :You can enable it directly typing: /msg $chan !youtube enable"}return        }global ourtubeXTRA::ytrest protection        #This is a generic protection to prevent flood        #No utimer required        if {![info exists protection ]} {        set protection [clock seconds]        } else {        if {![string is digit -strict $protection ]} {                set protection [clock seconds]                } else {                        set time [expr [clock seconds]-$protection]                        if { $time &gt;= $ytrest } {                        set protection [clock seconds]                        } else {set floodsecs [expr [clock seconds]-$protection]putserv "NOTICE $nick :${ourtubeXTRA::youtubelogo} \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                                return                        }                }        }        if {$text eq ""} {                putquick "NOTICE $nick :${ourtubeXTRA::youtubelogo} \00311:: \00315Usage: !youtube &lt;search criteria&gt;"                return        }if {[string length $text] &lt;= 3} {                putquick "NOTICE $nick :${ourtubeXTRA::youtubelogo} \00311:: \00315Error - Search parameter '$text' is too short."                return}        set data [ourtubeXTRAGet $text $chan]              if {[string length $data] == 0} {set data "I was unable to connect to that website. Probably I get timeout."return        }#Display results        foreach line $data {putquick "PRIVMSG $chan :$line"        }    }     proc ourtubeXTRAGet {ask chan} {global ourtubeXTRA::max_linksset resultcount "0"        regsub -all -- {\s+} $ask "" search        set search [http::formatQuery $search]        set token [http::geturl http://www.youtube.com/results?search_query=$search&amp;sm=12]        upvar #0 $token state        set data $state(body)        regsub -all {\n|\t|\r} $data "" data        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }        set ytlist ""        switch -- $ncode {"200" { regexp {&lt;p class=\"num-results\"&gt;About &lt;strong&gt;(.*?)&lt;/strong&gt;} $data "" uresultcountregexp -- {&lt;ol id=\"search-results\" class=\"result-list\"&gt;(.*?)$} $data -&gt; dataset videos [ regexp -all -inline {&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile\"(.*?)&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile\"} $data ]regsub -all {,} $uresultcount "" resultcount                set total [expr [llength $videos] /2]                if {$total &gt;= $max_links } {    set numitems $max_links} else {    set numitems $total                }if {$resultcount == 0} {    set numitems 0    set yts "${ourtubeXTRA::youtubelogo} \00311:: \00315$uresultcount \00315result(s) found for items matching '$ask'."} else {                    set yts "${ourtubeXTRA::youtubelogo} \00311:: \00315Showing \00300$numitems \00315of \00300$uresultcount \00315result(s) found for items matching '$ask'."}putquick "PRIVMSG $chan :$yts"putlog "Search URL: http://www.youtube.com/results?search_query=$search&amp;sm=12"                set i 2set vcount 1if {$resultcount &gt; 0} {                foreach {id line} $videos {                        set map ""                set title ""set title_parsed ""                set description "This video does not have any description"set description_parsed ""                set added "Unknown"                set viewcount "0"                set author "Unknown"                set link ""set duration ""set item_info ""set item_badges ""set badge_info ""set badge ""set badge1 ""set badge2 ""set badgelist ""                        foreach {entity number} [regexp -all -inline {&amp;#(\d+);} $line] {                           lappend map $entity [format \\u%04x [scan $number %d]]}set line [string map [subst -nocomm -novar $map] $line]regexp -all -- {&lt;div class=\"yt-lockup-content\"&gt;(.*?)$} $line "" item_info                        regexp {title=\"(.*?)\"} $item_info "" titleset tlen [ string length $title ]        set title_parsed [url_search $tlen "07" "style_ul" $title]regexp {href=\"(.*?)\"} $item_info "" linkregexp {&lt;div class=\"yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2\" dir=\"ltr\"&gt;(.*?)&lt;/div&gt;} $item_info "" descriptionregsub -all -- {(&lt;[^&gt;]+&gt;)|(\t)} $description "" description  set description [ string trimleft $description " " ]regexp {&lt;span class=\"video-time\"&gt;(.*?)&lt;/span&gt;} $line "" durationregexp {data-name=\"\"&gt;(.*?)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;(.*?)\&lt;} $line "" author added                        regexp {data-name=\"\"&gt;(.*?)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;(.*?)&lt;/li&gt;&lt;li&gt;(.*?) view} $line "" author added viewcountregexp -all -- {li class=\"yt-lockup-badge-item\"&gt;(.*?)$} $line "" item_infowhile {[regexp {&lt;span class=\"yt-badge \" &gt;(.*?)&lt;/span&gt;&lt;/li&gt;} $item_info "" badge1]} {if { $badge1 != "" } {if {[ string first $badge1 $badgelist 0] == -1 } {set badgelist [ append badgelist "$badge1 " ]}regsub -- {&lt;span class=\"yt-badge \" &gt;(.*?)&lt;/span&gt;&lt;/li&gt;} $item_info "" item_infoset badge1 ""}}set badgelist [ string trimright $badgelist " " ]set badgelist [ create_badgelist $badgelist ]set tlen [ string length $description ]        set description_parsed [url_search $tlen "07" "style_ul" $description]                        set yturl "http://www.youtube.com$link"set description_parsed [string range $description_parsed 0 100]set ytoutput [string map [list "&lt;vcount&gt;" $vcount "&lt;link&gt;" $yturl "&lt;title&gt;" $title_parsed "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $viewcount "&lt;duration&gt;" $duration "&lt;badgelist&gt;" $badgelist "&lt;description&gt;" $description_parsed] ${ourtubeXTRA::outputsearch}]set ytoutput [utfdecode $ytoutput]set ytoutput [encoding convertto utf-8 $ytoutput]                        lappend ytlist $ytoutput                        if {$i &gt; $ourtubeXTRA::max_links } {                            break                        }incr iincr vcount}}return $ytlist}"404" {        http::cleanup $token                return [list "No such file or webpage."]        }            default {                http::cleanup $token                return [list "unforeseen circumstance. Server responded: $ncode"]            }}    }     proc otPub {nick uhost hand chan text} {if {![channel get $chan ourtubeXTRA]} {            return        }global ourtubeXTRA::ytrest protection               set webTarget [lsearch -inline [split $text] {*http://*.youtube.*/watch?*}]        if {([info exists protection]) &amp;&amp; ([string is digit -strict $protection ])} {        set rest [expr [clock seconds]-$protection]            if { $rest &gt;= $ytrest } {                set protection ""}        } else {            set protection ""        }        if {$webTarget ne ""} {        if {![regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $webTarget]} {                return            }            if { $protection ne "" } {set floodsecs [expr [clock seconds]-$protection]putserv "NOTICE $nick :${ourtubeXTRA::youtubelogo} \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                return            }            set protection [clock seconds]            set data [otGet $webTarget]            if {[string length $data] == 0} {                set data "I was not able to reach Youtube's link. Probably I get a timeout. Try again."            }foreach line [ split $data \n ] {            putquick "PRIVMSG $chan :$line"}            utimer $ytrest [list set protection ""]        }}     proc otGet {web} {        set token [http::geturl $web -timeout 4000]        upvar #0 $token state        set data $state(body)        regsub -all {\n|\t|\r} $data "" data        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }        switch -- $ncode {        "200" {}            "302" {                foreach {flag value} $state(meta) {                    if {$flag eq "Location"} {                        http::cleanup $token                        return "Invalid youtube link: $ncode"                    }                }            }"303" {                http::cleanup $token                return "That video does not exists. Server responded: $ncode"            }            "404" {                http::cleanup $token                return "$ncode - $web - No such webpage"            }            default {                http::cleanup $token                return "unforeseen circumstances. Server responded: $ncode"            }}set durationfmt "%M:%S"set badges ""set badge1 ""set badge2 ""set numcomments 0set agestrict ""set title ""set title_parsed ""set description "This video does not have a description"set full_description "This video does not have a description"        if {[regexp {&lt;meta property=\"og:title\" content=\"(.*?)\"&gt;} $data "" title]} {set tlen [ string length $title ]set title_parsed [url_search $tlen "07" "style_ul" $title]}if {[regexp {&lt;meta property=\"og:video:height\" content=\"(.*?)\"&gt;} $data "" videoHeight]} {if { $videoHeight &gt;= 720 } { set badges [ append badges "HD "] }}if {[regexp {&lt;meta property=\"og:restrictions:age\" content=\"(.*?)\"&gt;} $data "" agestrict]} {set badges [ append badges "$agestrict "] }set badges [ string trimright $badges " " ]        regexp {&lt;meta property=\"og:description\" content=\"(.*?)\"&gt;} $data "" description#regexp -all {&lt;p id=\"eow-description\" &gt;(.*?)&lt;/p&gt;} $data "" full_descriptionregexp -all {&lt;div id=\"watch-description-text\"&gt;(.*?)&lt;/div&gt;} $data "" full_description#regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $full_description "" full_description#set full_description [encoding convertfrom utf-8 $full_description ]set full_description [string trimleft $full_description " "]#regsub -all {&lt;(.|\n)*?&gt;} $full_description "" full_description#regsub -all -- {(&lt;[^&gt;]+&gt;)|(\t)} $full_description "" full_description  set tlen [string length $full_description]set full_description [url_search $tlen "07" "style_ul" $full_description]set full_description_parsed [parse_text 380 $full_description]if {[string length $description] &lt;= 1} { set description "This video does not have a description" }set badgelist [ create_badgelist $badges ]set tlen [ string length $description ]set description_parsed [url_search $tlen "07" "style_ul" $description]if {[llength $full_description_parsed] == 0 } {set full_description_parsed {}lappend full_description_parsed $description_parsed}set added "Unknown"regexp {&lt;span id=\"eow-date\" class=\"watch-video-date\" &gt;(.*?)&lt;/span&gt;} $data "" addedset views "0"        regexp {&lt;span class=\"watch-view-count \" &gt;(.*?)&lt;/span&gt;} $data "" viewsset views [string trimright $views " views" ]set views [string trimleft $views]set added [string trimleft $added]        if {![regexp -all {&lt;span class=\"likes-count\"&gt;(.*?)&lt;/span&gt;} $data "" likes]} { set likes 0 }        if {![regexp -all {&lt;span class=\"dislikes-count\"&gt;(.*?)&lt;/span&gt;} $data "" dislikes]} { set dislikes 0 }set author "Unknown"       regexp -all {data-name=\"watch\"&gt;(.*?)&lt;/a&gt;&lt;span class=\"yt-user-separator\"&gt;} $data "" authorregexp -all {data-name=\"watch\"&gt;(.*?)&lt;/a&gt;} $data "" authorif {![regexp -all {&lt;meta itemprop=\"duration\" content=\"PT(.*?)M(.*?)S\"&gt;} $data "" videomins videosecs]} { set videomins 0set videosecs 0}set totalseconds [expr {($videomins * 60) + $videosecs}]if { $videomins &gt;= 60 } { set durationfmt "%H:%M:%S" }set duration [clock format $totalseconds -format $durationfmt]         set yt_output [string map [list "&lt;title&gt;" $title "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $views "&lt;duration&gt;" $duration "&lt;likes&gt;" $likes "&lt;dislikes&gt;" $dislikes "&lt;badgelist&gt;" $badgelist "&lt;full_description&gt;" $description_parsed] ${ourtubeXTRA::outputline} ]return [ utfdecode [encoding convertto utf-8 $yt_output] ]}putlog "\002\00304,00You\00300,04Tube\017 \00311:: \002\00300*Loaded* \002\00315ourtubeXTRA 1.0 by \002WazzaUK\002\00311 :: \00315based on ourtube by \002Hackemate\002."set Loaded 1}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Tue Mar 04, 2014 3:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-03-03T22:34:41-04:00</updated>

		<published>2014-03-03T22:34:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102646#p102646</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102646#p102646"/>
		<title type="html"><![CDATA[re: bunnybump]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102646#p102646"><![CDATA[
<blockquote class="uncited"><div>and now here what we got with your script:<br><br>Code:<br><br>Tcl error in file 'Eggdrop.conf':<br>invalid command name "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"<br>    while executing<br>""text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8""<br>    (file "scripts/OurtubeXTRA.tcl" line 71)<br>    invoked from within<br>"source scripts/OurtubeXTRA.tcl"<br>    (file "in" line 203)<br>* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)<br><br>are you sure that you already test it before make a post in here? cause every change that you've made seems never working Sad</div></blockquote>that line should be:<br><div class="codebox"><p>Code: </p><pre><code>http::config -useragent "Mozilla/5.0 ($platfrm; U; $tcl_platform(os) $tcl_platform(machine); $ourtubeXTRA(lang); rv:1.9.0.3) ourtubeXTRA 1.0" -accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Mon Mar 03, 2014 10:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bunnybump]]></name></author>
		<updated>2014-03-03T07:51:02-04:00</updated>

		<published>2014-03-03T07:51:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102642#p102642</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102642#p102642"/>
		<title type="html"><![CDATA[ourtubeXTRA 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102642#p102642"><![CDATA[
and now here what we got with your script:<br><div class="codebox"><p>Code: </p><pre><code>Tcl error in file 'Eggdrop.conf':invalid command name "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"    while executing""text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8""    (file "scripts/OurtubeXTRA.tcl" line 71)    invoked from within"source scripts/OurtubeXTRA.tcl"    (file "in" line 203)* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div>are you sure that you already test it before make a post in here? cause every change that you've made seems never working <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=12060">bunnybump</a> — Mon Mar 03, 2014 7:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-03-02T11:26:38-04:00</updated>

		<published>2014-03-02T11:26:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102638#p102638</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102638#p102638"/>
		<title type="html"><![CDATA[OurtubeXTRA search fix...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102638#p102638"><![CDATA[
it seems youtube changed output data again...<br><br>find the: <br><div class="codebox"><p>Code: </p><pre><code>set videos [ regexp -all -inline {&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile vve-check\"(.*?)&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile vve-check\"} $data ]</code></pre></div>and change to:<br><div class="codebox"><p>Code: </p><pre><code>set videos [ regexp -all -inline {&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile\"(.*?)&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile\"} $data ]</code></pre></div>Whole source uploaded to pastebin. <a href="http://pastebin.com/eLBMf4K9" class="postlink">Full TCL script</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Sun Mar 02, 2014 11:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anahel]]></name></author>
		<updated>2014-02-27T13:35:59-04:00</updated>

		<published>2014-02-27T13:35:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102630#p102630</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102630#p102630"/>
		<title type="html"><![CDATA[ourtubeXTRA 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102630#p102630"><![CDATA[
WazzaUK you should check script you're posting on site - you updated it but (tho it still doesn't work for me) somewhere you added word wrap making the script unusable - you need to fix broken lines in script.<br><br>Could you just upload the .tcl somewhere? or paste it to some pastebin instead of adding it in <div class="codebox"><p>Code: </p><pre><code></code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10737">Anahel</a> — Thu Feb 27, 2014 1:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-02-26T13:10:32-04:00</updated>

		<published>2014-02-26T13:10:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102621#p102621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102621#p102621"/>
		<title type="html"><![CDATA[OurTubeXTRA re-codes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102621#p102621"><![CDATA[
Ok so there was a few errors in the last release. It didnt help that youtube changed theyre form data structure. I know this one works, im still working on the utf-8 encoding.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br><div class="codebox"><p>Code: </p><pre><code>setudef flag ourtubeXTRAglobal ourtubeXTRA tcl_platform      #Flood Protection: after show a link, will ignore all links few seconds# This means 1 link per 10 seconds.set ourtubeXTRA(rest) 10     #What language you can receive the youTube data? (if works heh)set ourtubeXTRA(lang) en     #Limit of links at same timeset ourtubeXTRA(max) 5     #youtube logoset ourtubeXTRA(youtubelogo) "\002\00304,00You\00300,04Tube\017"          set ourtubeXTRA(output) "$ourtubeXTRA(youtubelogo) \00311:: \002\00309&lt;title&gt;\002\00311:: \00308Author: \00314&lt;author&gt; \00311:: \00308Added: \00314&lt;added&gt; \00311:: \00308Views: \00314&lt;views&gt; \00311:: \00308Duration: \00314&lt;duration&gt; \00311:: \00308Likes: \00309&lt;likes&gt; \00311:: \00308Dislikes: \00304&lt;dislikes&gt; \00311::\002\00312\&lt;badgelist&gt; \017\00314&lt;description&gt;"          set ourtubeXTRA(outputsearch) "\00309&lt;title&gt;\00311:: \00312\037&lt;link&gt;\003\037 \00311:: \00308Author: \00314&lt;author&gt; \00311:: \00308Added: \00314&lt;added&gt; \00311:: \00308Views: \00314&lt;views&gt; \00311:: \00308Duration: \00314&lt;duration&gt; \00311::\002\00312&lt;badgelist&gt;\017\00314&lt;description&gt;"          set ourtubeXTRA(author) "WazzaUK"set ourtubeXTRA(contact) "WazzaUK &lt;wallison_uk@yahoo.co.uk&gt;"set ourtubeXTRA(originalauthor) "HackeMate"set ourtubeXTRA(originalcontact) "HackeMate &lt;Sentencia@eggdrop.es&gt;"set ourtubeXTRA(name) "ourtubeXTRA"set ourtubeXTRA(projectName) "ourtubeXTRA"set ourtubeXTRA(version) "1.0"set ourtubeXTRA(package.http) [package require http]set ourtubeXTRA(protection) ""if {$tcl_platform(os) eq "Linux"} {set platfrm "X11"} else {set platfrm $tcl_platform(os)}http::config -useragent "Mozilla/5.0 ($platfrm; U; $tcl_platform(os) $tcl_platform(machine); $ourtubeXTRA(lang); rv:1.9.0.3) ourtubeXTRA 1.0" -accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"     bind pub - !youtube otYoutubebind pubm - *http://www.youtube.com/watch?* otPubproc create_badgelist {badges} {set badgelist ""if { $badges ne "" } {foreach badge [split $badges] {append badgelist " \[$badge\]"}}return $badgelist}proc url_search {maxlen color styles text} {set i 0set newtext ""set style_ul ""set style_bd ""  if {![string is integer -strict $maxlen]} {set maxlen [ string length $text ] }        if {($maxlen == "") || ($maxlen &lt; 1)} {set maxlen [ string length $text ]}if {![string is alpha -strict $styles]} {set styles "style_ul"}if {[string match -nocase style_ul $styles]} {set style_ul "\037"}if {[string match -nocase style_bd $styles]} {set style_bd "\002"}if {![string is integer -strict $color]} {set color "07"}        if {($color &lt; 0) || ($color &gt; 15)} {set color 07}foreach word [split $text] {set urlindex -1        if {[string length $word] &gt;= 5 &amp;&amp; [regexp {(f|ht)tp(s|)://} $word] &amp;&amp; ![regexp {://([^/:]*:([^/]*@|\d+(/|$))|.*/\.)} $word]} {set wprotocol ""regexp {(f|ht)tp(s|)://} $word "" wprotocolset urlindex [string first $wprotocol $word 0]set newword [string range $word $urlindex [string length $word]]set oldlen [expr [string first $wprotocol $word 0] -1 ]set oldword [string range $word 0 $oldlen]             incr iif { $urlindex &gt; 0 } { append oldword " " }     set word "$oldword\003${color}${style_bd}${style_ul}$newword\00314${style_bd}${style_ul}"}append newtext $word " "}return $newtext}proc utfdecodeclean {string} {regsub -all -- {([\(\)\[\]\{\}\$\"\\])} $string {\\\1} string        return $string} proc utfdecode {content} {if {![regexp -- &amp; $content]} {return $content}set escapes {  \xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4¥ \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 À \xc0 Á \xc1 Â \xc2Ã \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xccÍ \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6× \xd7 Ø \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 ÷ \xf7 ø \xf8 ù \xf9ú \xfa û \xfb ü \xfc ý \xfd þ \xfeÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39EΟ \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BAλ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BFπ \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F∑ \u2211 − \u2212 ∗ \u2217 √ \u221A∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A⌋ \u230B 〈 \u2329 〉 \u232A ◊ \u25CA♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666" \x22 &amp; \x26 &lt; \x3C &gt; \x3E O&amp;Elig; \u152 œ \u153Š \u160 š \u161 Ÿ \u178 ˆ \u2C6˜ \u2DC   \u2002   \u2003   \u2009‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A“ \u201C ” \u201D „ \u201E † \u2020‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A€ \u20AC &amp;apos; \u0027 ‎ "" ‏ "" ‬ "" ‭ ""‮ "" — \u2014}set content [string map $escapes $content]     regsub -all -- {&amp;[a-zA-Z]+?;} [utfdecodeclean $content] {?} content     regsub -all -- {&amp;#(\d{1,3});} $content {[format %c [scan \1 %d]]} content     return [subst $content]}proc otYoutube {nick uhost hand chan text} {global ourtubeXTRAif {![channel get $chan ourtubeXTRA]} {        if {$text eq "enable"} {                channel set $chan +ourtubeXTRA                        return                } else {putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315$chan has this command disabled."                       }if {[matchattr $hand n]} {putquick "NOTICE $nick :You can enable it directly typing: /msg $chan !youtube enable"}return        }        #This is a generic protection to prevent flood        #No utimer required        if {![info exists ourtubeXTRA(protection)]} {        set ourtubeXTRA(protection) [clock seconds]        } else {        if {![string is digit -strict $ourtubeXTRA(protection)]} {                set ourtubeXTRA(protection) [clock seconds]                } else {                        set time [expr [clock seconds]-$ourtubeXTRA(protection)]                        if {$time &gt;= $ourtubeXTRA(rest)} {                        set ourtubeXTRA(protection) [clock seconds]                        } else {set floodsecs [expr [clock seconds]-$ourtubeXTRA(protection)]putserv "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                                return                        }                }        }        if {$text eq ""} {                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Usage: !youtube &lt;search criteria&gt;"                return        }if {[string length $text] &lt;= 3} {                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Error - Search parameter '$text' is too short."                return}        set data [ourtubeXTRAGet $text]              if {[string length $data] == 0} {set data "I was unable to connect to that website. Probably I get timeout."return        }#Display results        foreach line $data {putquick "PRIVMSG $chan :$line"        }    }     proc ourtubeXTRAGet {ask} {global ourtubeXTRAset resultcount "0"        regsub -all -- {\s+} $ask "" search        set search [http::formatQuery $search]        set token [http::geturl http://www.youtube.com/results?search_query=$search&amp;sm=12]         upvar #0 $token state        set data $state(body)        #regsub -all {\s|\n|\r|\t|\f} $data "" dataset data [ utfdecode $data ]        regsub -all {\n|\t|\r} $data "" data        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }        set list {}        switch -- $ncode {"200" { regexp {&lt;p class=\"num-results\"&gt;About &lt;strong&gt;(.*?)&lt;/strong&gt;} $data "" uresultcountregexp -- {&lt;ol id=\"search-results\" class=\"result-list\"&gt;(.*?)$} $data -&gt; dataset videos [ regexp -all -inline {&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile vve-check\"(.*?)&lt;li class="yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile vve-check\"} $data ]regsub -all {,} $uresultcount "" resultcount                set total [expr [llength $videos] /2]                if {$total &gt;= $ourtubeXTRA(max)} {    set numitems $ourtubeXTRA(max)} else {    set numitems $total                }if {$resultcount == 0} {    set numitems 0    set list [list "$ourtubeXTRA(youtubelogo) \00311:: \00315$uresultcount \00315result(s) found for items matching '$ask'."]} else {                    set list [list "$ourtubeXTRA(youtubelogo) \00311:: \00315Showing \00300$numitems \00315of \00300$uresultcount \00315result(s) found for items matching '$ask'."]}                set i 2if {$resultcount &gt; 0} {                foreach {id line} $videos {                        set map {}                set title ""set title_parsed ""                set description "This video does not have any description"set description_parsed ""                set added "Unknown"                set viewcount "0"                set author "Unknown"                set link ""set duration ""set item_info ""set item_badges ""set badge_info ""set badge ""set badge1 ""set badge2 ""set badgelist ""                        foreach {entity number} [regexp -all -inline {&amp;#(\d+);} $line] {                           lappend map $entity [format \\u%04x [scan $number %d]]}set line [string map [subst -nocomm -novar $map] $line]regexp -all -- {&lt;div class=\"yt-lockup-content\"&gt;(.*?)$} $line "" item_info                        regexp {title=\"(.*?)\"} $item_info "" title                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" titleset tlen [ string length $title ]        set title_parsed [url_search $tlen "07" "style_ul" $title]regexp {href=\"(.*?)\"} $item_info "" linkregexp {&lt;div class=\"yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2\" dir=\"ltr\"&gt;(.*?)&lt;/div&gt;} $item_info "" description                        regexp {&lt;span class=\"video-time\"&gt;(.*?)&lt;/span&gt;} $line "" duration                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $duration "" duration                        regexp {data-name=\"\"&gt;(.*?)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;(.*?)&lt;/li&gt;&lt;li&gt;(.*?) views&lt;/li&gt;} $line "" author added viewcount                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $author "" authorregsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $added "" addedregsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $viewcount "" viewcountregsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" descriptionregexp -all -- {li class=\"yt-lockup-badge-item\"&gt;(.*?)$} $line "" item_infowhile {[regexp {&lt;span class=\"yt-badge \" &gt;(.*?)&lt;/span&gt;&lt;/li&gt;} $item_info "" badge1]} {if { $badge1 != "" } {if {[ string first $badge1 $badgelist 0] == -1 } {set badgelist [ append badgelist "$badge1 " ]}regsub -- {&lt;span class=\"yt-badge \" &gt;(.*?)&lt;/span&gt;&lt;/li&gt;} $item_info "" item_infoset badge1 ""}}set badgelist [ string trimright $badgelist " " ]set badgelist [ create_badgelist $badgelist ]set tlen [ string length $description ]        set description_parsed [url_search $tlen "07" "style_ul" $description]                        set yturl "http://www.youtube.com$link"set output [string map [list "&lt;title&gt;" $title_parsed "&lt;link&gt;" $yturl "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $viewcount "&lt;duration&gt;" $duration "&lt;badgelist&gt;" $badgelist "&lt;description&gt;" $description_parsed] $ourtubeXTRA(outputsearch)]                        lappend list $output                        if {$i &gt; $ourtubeXTRA(max)} {                            break                        }incr i}}        return [encoding convertto utf-8 $list]}"404" {        http::cleanup $token                return [list "No such file or webpage."]        }            default {                http::cleanup $token                return [list "unforeseen circumstance. Server responded: $ncode"]            }}    }     proc otPub {nick uhost hand chan text} {if {![channel get $chan ourtubeXTRA]} {            return        }        global ourtubeXTRA               set webTarget [lsearch -inline [split $text] {*http://*.youtube.*/watch?*}]        if {([info exists ourtubeXTRA(protection)]) &amp;&amp; ([string is digit -strict $ourtubeXTRA(protection)])} {        set rest [expr [clock seconds]-$ourtubeXTRA(protection)]            if {$rest &gt;= $ourtubeXTRA(rest)} {                set ourtubeXTRA(protection) ""}        } else {            set ourtubeXTRA(protection) ""        }        if {$webTarget ne ""} {        if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $webTarget]} {                return            }            if {$ourtubeXTRA(protection) ne ""} {set floodsecs [expr [clock seconds]-$ourtubeXTRA(protection)]putserv "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                return            }            set ourtubeXTRA(protection) [clock seconds]            set data [otGet $webTarget]            if {[string length $data] == 0} {                set data "I was not able to reach Youtube's link. Probably I get a timeout. Try again."            }            putquick "PRIVMSG $chan :$data"            utimer $ourtubeXTRA(rest) [list set ourtubeXTRA(protection) ""]        }}     proc otGet {web} {global ourtubeXTRA        set token [http::geturl $web -timeout 4000]        upvar #0 $token state        set data $state(body)set data [ utfdecode $data ]        regsub -all {\n|\t|\r} $data "" data        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }        switch -- $ncode {        "200" {}            "302" {                foreach {flag value} $state(meta) {                    if {$flag eq "Location"} {                        http::cleanup $token                        return "Invalid youtube link: $ncode"                    }                }            }"303" {                http::cleanup $token                return "That video does not exists. Server responded: $ncode"            }            "404" {                http::cleanup $token                return "$ncode - $web - No such webpage"            }            default {                http::cleanup $token                return "unforeseen circumstances. Server responded: $ncode"            }}set durationfmt "%M:%S"set badges ""set badge1 ""set badge2 ""set agestrict ""set title ""set title_parsed ""        if {[regexp {&lt;meta property=\"og:title\" content=\"(.*?)\"&gt;} $data "" title]} {set tlen [ string length $title ]set title_parsed [url_search $tlen "07" "style_ul" $title]}if {[regexp {&lt;meta property=\"og:video:height\" content=\"(.*?)\"&gt;} $data "" videoHeight]} {if { $videoHeight &gt;= 720 } { set badges [ append badges "HD "] }}if {[regexp {&lt;meta property=\"og:restrictions:age\" content=\"(.*?)\"&gt;} $data "" agestrict]} {set badges [ append badges "$agestrict "] }set badges [ string trimright $badges " " ];        regexp {&lt;meta property=\"og:description\" content=\"(.*?)\"&gt;} $data "" descriptionif { $description eq "" } { set description "This video does not have a description" }set badgelist [ create_badgelist $badges ]set tlen [ string length $description ]set description_parsed [url_search $tlen "07" "style_ul" $description]set added "Unknown"regexp {&lt;span id=\"eow-date\" class=\"watch-video-date\" &gt;(.*?)&lt;/span&gt;} $data "" addedset views "0"        regexp {&lt;span class=\"watch-view-count \" &gt;(.*?)&lt;/span&gt;} $data "" viewsset views [string trimright $views " views" ]set views [string trimleft $views]        if {![regexp -all {&lt;span class=\"likes-count\"&gt;(.*?)&lt;/span&gt;} $data "" likes]} { set likes 0 }        if {![regexp -all {&lt;span class=\"dislikes-count\"&gt;(.*?)&lt;/span&gt;} $data "" dislikes]} { set dislikes 0 }set author "Unknown"        regexp -all {data-name=\"watch\"&gt;(.*?)&lt;/a&gt;&lt;span class=\"yt-user-separator\"&gt;} $data "" authorregexp -all {data-name=\"watch\"&gt;(.*?)&lt;/a&gt;} $data "" authorif {![regexp -all {&lt;meta itemprop=\"duration\" content=\"PT(.*?)M(.*?)S\"&gt;} $data "" videomins videosecs]} { set videomins 0set videosecs 0}set totalseconds [expr {($videomins * 60) + $videosecs}]if { $videomins &gt;= 60 } { set durationfmt "%H:%M:%S" }set duration [clock format $totalseconds -format $durationfmt]         set yt_output [string map [list "&lt;title&gt;" $title_parsed "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $views "&lt;duration&gt;" $duration "&lt;likes&gt;" $likes "&lt;dislikes&gt;" $dislikes "&lt;badgelist&gt;" $badgelist "&lt;description&gt;" $description_parsed] $ourtubeXTRA(output)]return [ encoding convertto utf-8 $yt_output ]}putlog "\002\00304,00You\00300,04Tube\017 \00311:: \002\00300*Loaded* \002\00315ourtubeXTRA 1.0 by \002WazzaUK\002\00311 :: \00315based on ourtube by \002Hackemate\002."set ourtubeXTRA(Loaded) 1</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Wed Feb 26, 2014 1:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anahel]]></name></author>
		<updated>2014-02-24T14:41:14-04:00</updated>

		<published>2014-02-24T14:41:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102607#p102607</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102607#p102607"/>
		<title type="html"><![CDATA[ourtubeXTRA 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102607#p102607"><![CDATA[
WazzaUK each time I want to load your script i get this:<br><div class="codebox"><p>Code: </p><pre><code>[19:38:11] Tcl error in file 'neko.conf':[19:38:11] missing close-brace    while executing"proc url_search {maxlen color styles text} {   set i 0   set newtext ""   set style_ul ""   set style_bd ""   if  {[string is integer -strict $m..."    (file "scripts/ourtube.tcl" line 43)    invoked from within"source scripts/ourtube.tcl"    (file "neko.conf" line 1509)[19:38:11] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div>Could you post your script somewhere instead of inside <div class="codebox"><p>Code: </p><pre><code> on forum?</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10737">Anahel</a> — Mon Feb 24, 2014 2:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bunnybump]]></name></author>
		<updated>2014-02-21T15:39:55-04:00</updated>

		<published>2014-02-21T15:39:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102603#p102603</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102603#p102603"/>
		<title type="html"><![CDATA[ourtubeXTRA 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102603#p102603"><![CDATA[
i've try this tcl but it keeps telling me that there's an error with the script. here what i got:<br><div class="codebox"><p>Code: </p><pre><code> can't read "maxlen": no such variable    while executing"string is integer -strict $maxlen"    invoked from within"if  {[string is integer -strict $maxlen]} {           if {($maxlen == "") || ($maxlen &lt; 1)} {set maxlen 100}        } else { set maxlen "100" }"    (file "scripts/you.tcl" line 50)</code></pre></div>what should i do to fix it? thank you in advance for the help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12060">bunnybump</a> — Fri Feb 21, 2014 3:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-01-12T11:49:57-04:00</updated>

		<published>2014-01-12T11:49:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102475#p102475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102475#p102475"/>
		<title type="html"><![CDATA[ourtubeXTRA 1.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102475#p102475"><![CDATA[
A rework of ourtube with extra data. Lots of new additions including URL detection. Also removed some of the original functionality such as ability to turn on/off color and multi/single line. Deals with utf-8 via encoding function, i think eggdrop has to be properly patched. I use 1.6.21 and works nicely.<br><br>To enable on channels , in dcc add user defined flag with:<br><br>.chanset #channel +ourtubeXTRA<br><br>or in the channel window:<br><br>/msg #channel !youtube enable<br><br>if a youtube URL is detected in channel, details are taken from youtube site. Videos can be searched for using:<br><br>!youtube &lt;search  criteria&gt;<br><br>To enable on channels , in dcc add user defined flag with:<br><br>.chanset #channel +ourtubeXTRAsearch<br><br>or in the channel window:<br><br>/msg #channel !youtube enablesearch<br><br>Forgive the bad identation. Its perfect in my editor.<br><br>EDIT: now detects URLs in Title. Small modifiucation in how $data is set - no longer uses string map, afterall utf-8 decoding is done at time of output. <br>Parameters maxlen(max length of parsed text), color(00-15 - color of url) and styles(can be style_ul and/or style_bd) added to url_search proc. Called like: <div class="codebox"><p>Code: </p><pre><code>set text_parsed [url_search 40 07 "style_ul" $text]</code></pre></div>If incorrect string classes used/bad values default values should hopefully be set.<br>Now has 2 user defined channel flags:<br>ourtubeXTRA for youtube URL detection in a channel.<br>ourtubeXTRAsearch for youtube video searching. <br><div class="codebox"><p>Code: </p><pre><code>setudef flag ourtubeXTRAsetudef flag ourtubeXTRAsearchglobal ourtubeXTRA tcl_platform     #Flood Protection: after show a link, will ignore all links few seconds# This means 1 link per 10 seconds.set ourtubeXTRA(rest) 10     #What language you can receive the youTube data? (if works heh)set ourtubeXTRA(lang) en     #Limit of links at same timeset ourtubeXTRA(max) 5     #youtube logoset ourtubeXTRA(youtubelogo) "\002\00304,00You\00300,04Tube\017"          set ourtubeXTRA(output) "$ourtubeXTRA(youtubelogo) \00311::\00315 &lt;title&gt; \00311:: \00308Author: \00315&lt;author&gt; \00311:: \00308Added: \00315&lt;added&gt; \00311:: \00308Views: \00315&lt;views&gt; \00311:: \00308Duration: \00315&lt;duration&gt; \00311:: \00308Likes: \00309&lt;likes&gt; \00311:: \00308Dislikes: \00304&lt;dislikes&gt; \00311:: \00308Description: \00315&lt;description&gt;"          set ourtubeXTRA(outputsearch) "\00312\037&lt;link&gt;\003\037 \00311:: \00308Title: \00315&lt;title&gt; \00311:: \00308Author: \00315&lt;author&gt; \00311:: \00308Added: \00315&lt;added&gt; \00311:: ;\00308Views: \00315&lt;views&gt; \00311:: \00308Duration: \00315&lt;duration&gt; \00311:: \00308Description: \00315&lt;description&gt;"          set ourtubeXTRA(author) "WazzaUK"set ourtubeXTRA(contact) "WazzaUK &lt;wallison_uk@yahoo.co.uk&gt;"set ourtubeXTRA(originalauthor) "HackeMate"set ourtubeXTRA(originalcontact) "HackeMate &lt;Sentencia@eggdrop.es&gt;"set ourtubeXTRA(name) "ourtubeXTRA"set ourtubeXTRA(projectName) "ourtubeXTRA"set ourtubeXTRA(version) "1.0"set ourtubeXTRA(package.http) [package require http]set ourtubeXTRA(protection) ""if {$tcl_platform(os) eq "Linux"} {set platfrm "X11"} else {set platfrm $tcl_platform(os)}http::config -useragent "Mozilla/5.0 ($platfrm; U; $tcl_platform(os) $tcl_platform(machine); $ourtubeXTRA(lang); rv:1.9.0.3) ourtubeXTRA 1.0" -accept  "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"     bind pub - !youtube otYoutubebind pubm - *http://www.youtube.com/watch?* otPubproc url_search {maxlen color styles text} {set i 0set newtext ""set style_ul ""set style_bd ""if  {[string is integer -strict $maxlen]} {        if {($maxlen == "") || ($maxlen &lt; 1)} {set maxlen 100}        } else { set maxlen 100 }if {[string is list -strict $styles]} {        if {[string match -nocase "*style_ul*" [lrange [split $styles] 0 end]]} {set style_ul "\037"}        if {[string match -nocase "*style_bd*" [lrange [split $styles] 0 end]]} {set style_bd "\002"}        } if {[string is integer -strict $color]} {                if {($color &lt; 0) || ($color &gt; 15)} {set color 07}        } else { set color "07" }foreach word [split $text] {        if {[string length $word] &gt;= 5 &amp;&amp; [regexp {(f|ht)tp(s|)://} $word] &amp;&amp; ![regexp {://([^/:]*:([^/]*@|\d+(/|$))|.*/\.)} $word]} {set urlindex [string first "http" $word 0]set newword [string range $word $urlindex [string length $word]]set oldlen [expr [string first "http" $word 0] -1 ]set oldword [string range $word 0 $oldlen]             incr iset color "\3${color}"     set word "$oldword${color}${style_ul}${style_bd}$newword\00315${style_ul}${style_bd}"if {$word != ""} {set newtext [append newtext $word " "]}set olen [string length $newtext]if {$olen &gt;= $maxlen} {        set newtext [append newtext "..."]             return $newtext      }}return $newtext}proc utfdecodeclean {string} {regsub -all -- {([\(\)\[\]\{\}\$\"\\])} $string {\\\1} string        return $string} proc utfdecode {content} {if {![regexp -- &amp; $content]} {return $content}set escapes {  \xa0 ¡ \xa1 ¢ \xa2 £ \xa3 ¤ \xa4¥ \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 À \xc0 Á \xc1 Â \xc2Ã \xc3 Ä \xc4 Å \xc5 Æ \xc6 Ç \xc7È \xc8 É \xc9 Ê \xca Ë \xcb Ì \xccÍ \xcd Î \xce Ï \xcf Ð \xd0 Ñ \xd1Ò \xd2 Ó \xd3 Ô \xd4 Õ \xd5 Ö \xd6× \xd7 Ø \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 ÷ \xf7 ø \xf8 ù \xf9ú \xfa û \xfb ü \xfc ý \xfd þ \xfeÿ \xff ƒ \u192 Α \u391 Β \u392 Γ \u393 Δ \u394Ε \u395 Ζ \u396 Η \u397 Θ \u398 Ι \u399Κ \u39A Λ \u39B Μ \u39C Ν \u39D Ξ \u39EΟ \u39F Π \u3A0 Ρ \u3A1 Σ \u3A3 Τ \u3A4Υ \u3A5 Φ \u3A6 Χ \u3A7 Ψ \u3A8 Ω \u3A9α \u3B1 β \u3B2 γ \u3B3 δ \u3B4 ε \u3B5ζ \u3B6 η \u3B7 θ \u3B8 ι \u3B9 κ \u3BAλ \u3BB μ \u3BC ν \u3BD ξ \u3BE ο \u3BFπ \u3C0 ρ \u3C1 ς \u3C2 σ \u3C3 τ \u3C4υ \u3C5 φ \u3C6 χ \u3C7 ψ \u3C8 ω \u3C9ϑ \u3D1 ϒ \u3D2 ϖ \u3D6 • \u2022… \u2026 ′ \u2032 ″ \u2033 ‾ \u203E⁄ \u2044 ℘ \u2118 ℑ \u2111 ℜ \u211C™ \u2122 ℵ \u2135 ← \u2190 ↑ \u2191→ \u2192 ↓ \u2193 ↔ \u2194 ↵ \u21B5⇐ \u21D0 ⇑ \u21D1 ⇒ \u21D2 ⇓ \u21D3 ⇔ \u21D4∀ \u2200 ∂ \u2202 ∃ \u2203 ∅ \u2205∇ \u2207 ∈ \u2208 ∉ \u2209 ∋ \u220B ∏ \u220F∑ \u2211 − \u2212 ∗ \u2217 √ \u221A∝ \u221D ∞ \u221E ∠ \u2220 ∧ \u2227 ∨ \u2228∩ \u2229 ∪ \u222A ∫ \u222B ∴ \u2234 ∼ \u223C≅ \u2245 ≈ \u2248 ≠ \u2260 ≡ \u2261 ≤ \u2264≥ \u2265 ⊂ \u2282 ⊃ \u2283 ⊄ \u2284 ⊆ \u2286⊇ \u2287 ⊕ \u2295 ⊗ \u2297 ⊥ \u22A5⋅ \u22C5 ⌈ \u2308 ⌉ \u2309 ⌊ \u230A⌋ \u230B 〈 \u2329 〉 \u232A ◊ \u25CA♠ \u2660 ♣ \u2663 ♥ \u2665 ♦ \u2666" \x22 &amp; \x26 &lt; \x3C &gt; \x3E O&amp;Elig; \u152 œ \u153Š \u160 š \u161 Ÿ \u178 ˆ \u2C6˜ \u2DC   \u2002   \u2003   \u2009‌ \u200C ‍ \u200D ‎ \u200E ‏ \u200F – \u2013— \u2014 ‘ \u2018 ’ \u2019 ‚ \u201A“ \u201C ” \u201D „ \u201E † \u2020‡ \u2021 ‰ \u2030 ‹ \u2039 › \u203A€ \u20AC &amp;apos; \u0027 ‎ "" ‏ "" ‬ "" ‭ ""‮ "" — \u2014}set content [string map $escapes $content]     regsub -all -- {&amp;[a-zA-Z]+?;} [utfdecodeclean $content] {?} content     regsub -all -- {&amp;#(\d{1,3});} $content {[format %c [scan \1 %d]]} content     return [subst $content]}      proc otYoutube {nick uhost hand chan text} {global ourtubeXTRAif {![channel get $chan ourtubeXTRA]} {        if {$text eq "enable"} {                channel set $chan +ourtubeXTRAif {[channel get $chan ourtubeXTRA]} {               putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315ourtubeXTRA 1.0"putquick "NOTICE $nick :Youtube URL detection was successfully ENABLED on $chan"return}return                }         }if {![channel get $chan ourtubeXTRAsearch]} {        if {$text eq "enablesearch"} {                channel set $chan +ourtubeXTRAsearchif {[channel get $chan ourtubeXTRAsearch]} {putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315ourtubeXTRA 1.0"putquick "NOTICE $nick :Video search was successfully ENABLED on $chan"return}}                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315ourtubeXTRA 1.0"putquick "NOTICE $nick :$chan has the youtube search command DISABLED"                if {[matchattr $hand n]} {                putquick "NOTICE $nick :You can ENABLE it directly by typing:\002 /msg $chan !youtube enablesearch\002"}return}        #This is a generic protection to prevent flood        #No utimer required        #        if {![info exists ourtubeXTRA(protection)]} {        set ourtubeXTRA(protection) [clock seconds]        } else {        if {![string is digit -strict $ourtubeXTRA(protection)]} {                set ourtubeXTRA(protection) [clock seconds]                } else {                        set time [expr [clock seconds]-$ourtubeXTRA(protection)]                        if {$time &gt;= $ourtubeXTRA(rest)} {                        set ourtubeXTRA(protection) [clock seconds]                        } else {set floodsecs [expr [clock seconds]-$ourtubeXTRA(protection)]putserv "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                                return                        }                }        }             if {$text eq ""} {                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Usage: !youtube &lt;search criteria&gt;"                return        }if {[string length $text] &lt;= 3} {                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Error - Search parameter '$arg' is too short."                return}        set data [ourtubeXTRAGet $text]              if {[string length $data] == 0} {set data "I was unable to connect to that website. Probably I get timeout."return        }#Display results        foreach line $data {putquick "PRIVMSG $chan :$line"        }    }     proc ourtubeXTRAGet {ask} {global ourtubeXTRAset resultcount "0"        regsub -all -- {\s+} $ask "" search        set search [http::formatQuery $search]        http::config -useragent "Mozilla/5.0 (Windows NT; U; Windows NT x86; en-ES; rv:1.9.0.3) Firefox 3.0.7" -accept "text/html,application/xhtml,+xml,application/xml;q=0.9,*/*;q=0.8"        set token [http::geturl http://www.youtube.com/results?search_query=$search]        upvar #0 $token state        set data $state(body)        regsub -all {\n|\t} $data "" data        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }        set list {}        switch -- $ncode {"200" { regexp {&lt;p class=\"num-results\"&gt;About &lt;strong&gt;(.*?)&lt;/strong&gt;} $data "" resultcountregexp -- {&lt;ol id=\"search-results\" class=\"result-list context-data-container\"&gt;(.*)$} $data -&gt; data                set videos [regexp -all -inline {&lt;li class=\"yt-lockup clearfix yt-uix-tile result-item-padding yt-lockup-video yt-lockup-tile vve-check context-data-item\"(.*?)&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;} $data]                 set total [expr [llength $videos] /2]                if {$total &gt;= $ourtubeXTRA(max)} {    set numitems $ourtubeXTRA(max)} else {    set numitems $total                } if {$resultcount == 0} {    set numitems 0    set list [list "$ourtubeXTRA(youtubelogo) \00311:: \00315$resultcount \00315result(s) found for items matching '$ask'."]} else {                    set list [list "$ourtubeXTRA(youtubelogo) \00311:: \00315Showing \00300$numitems \00315of \00300$resultcount \00315result(s) found for items matching '$ask'."]}                set i 2if {$resultcount &gt; 0} {                foreach {id line} $videos {                        set map {}                set title ""                set description ""set description_parsed ""                set added "Unknown"                set viewcount "0"                set author "Unknown"                set link ""set duration ""                        foreach {entity number} [regexp -all -inline {&amp;#(\d+);} $line] {                           lappend map $entity [format \\u%04x [scan $number %d]]}                        set line [string map [subst -nocomm -novar $map] $line]                                           regexp {data-context-item-title=\"(.*?)\"} $line "" title                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" title        set title_parsed [url_search 40 07 "style_ul" $title]        if {![regexp {data-context-item-views=\"(.*?)views} $line "" viewcount]} { set viewcount "0" }                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $viewcount "" viewcount                        regexp {data-context-item-time=\"(.*?)\"} $line "" duration                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $duration "" duration                        regexp {&lt;div class=\"yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2\" dir=\"ltr\"&gt;(.*?)&lt;/div&gt;} $line "" description                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" descriptionif {$description == ""} {set description "This video doesn't have any description ..."}        set description_parsed [url_search 100 07 "style_ul" $description]                        regexp {&lt;/a&gt;&lt;/li&gt;&lt;li&gt;(.*?)&lt;/li&gt;} $line "" added                        regexp {data-context-item-user=\"(.*?)\"} $line "" author                        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $author "" author                        regexp {data-context-item-id=\"(.*?)\"} $line "" link                        set link "http://www.youtube.com/watch?v=$link"                        set output [string map [list "&lt;link&gt;" $link "&lt;title&gt;" $title_parsed "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $viewcount "&lt;duration&gt;" $duration "&lt;description&gt;" $description_parsed] $ourtubeXTRA(outputsearch)]                        lappend list $output                        if {$i &gt; $ourtubeXTRA(max)} {                            break                        }                        incr i}}                set list [utfdecode $list]return [encoding convertto utf-8 $list]}"404" {        http::cleanup $token                return [list "No such file or webpage."]        }            default {                http::cleanup $token                return [list "unforeseen circumstance. Server responded: $ncode"]            }}    }     proc otPub {nick uhost hand chan text} {global ourtubeXTRAif {![channel get $chan ourtubeXTRA]} {                putquick "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315ourtubeXTRA 1.0"putquick "NOTICE $nick :$chan has the youtube URL detector DISABLED"                if {[matchattr $hand n]} {                putquick "NOTICE $nick :You can ENABLE it directly by typing:\002 /msg $chan !youtube enable\002"}                return        }        set webTarget [lsearch -inline [split $text] {*http://*.youtube.*/watch?*}]        if {([info exists ourtubeXTRA(protection)]) &amp;&amp; ([string is digit -strict $ourtubeXTRA(protection)])} {        set rest [expr [clock seconds]-$ourtubeXTRA(protection)]            if {$rest &gt;= $ourtubeXTRA(rest)} {                set ourtubeXTRA(protection) ""}        } else {            set ourtubeXTRA(protection) ""        }        if {$webTarget ne ""} {        if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $webTarget]} {                return            }            if {$ourtubeXTRA(protection) ne ""} {set floodsecs [expr [clock seconds]-$ourtubeXTRA(protection)]putserv "NOTICE $nick :$ourtubeXTRA(youtubelogo) \00311:: \00315Flood protection triggered: $floodsecs second(s) remaining."                return            }            set ourtubeXTRA(protection) [clock seconds]            set data [otGet $webTarget]            if {[string length $data] == 0} {                set data "I was not able to reach Youtube's link. Probably I get a timeout. Try again."            }            putquick "PRIVMSG $chan :$data"            utimer $ourtubeXTRA(rest) [list set ourtubeXTRA(protection) ""]        }}     proc otGet {web {relocation ""}} {global ourtubeXTRA        set token [http::geturl $web -timeout 4000]        upvar #0 $token state        set lastcode $state(http)        set ncode ""        regexp {[0-9]{3}} $lastcode ncode        if {$ncode eq ""} {            set ncode $lastcode        }        switch -- $ncode {        "200" {}            "302" {                foreach {flag value} $state(meta) {                    if {$flag eq "Location"} {                        # Due to invalid youtube link but valid url syntax we can                        # receive an url forward. this handles that                        http::cleanup $token                        return [otGet $value "(Relocated)"]                    }                }            }"303" {                http::cleanup $token                return "That video does not exists. Server responded: $lastcode"            }            "404" {                http::cleanup $token                return "$web - No such webpage"            }            default {                http::cleanup $token                return "unforeseen circumstances. Server responded: $lastcode"            }}set data $state(body)             http::cleanup $tokenset title ""        set author "Unknown"set added "Unknown"        set description "This video doesn't have any description..."        set views "0"set author "Unknown"        set likes "0"set dislikes "0"set userinfo ""set duration ""set totalseconds 0set videosecs 0set videomins 0        regexp {&lt;title&gt;(.*?)&lt;/title&gt;} $data "" titleset title [string trimright $title " - YouTube"]        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" titleset title_parsed [url_search 40 07 "style_ul" $title]        regexp {&lt;meta name=\"description\" content=\"(.*?)\"&gt;.*} $data " " descriptionregexp {&lt;span id=\"eow-date\" class=\"watch-video-date\" &gt;(.*?)&lt;/span&gt;} $data "" added        # following two lines were edited from original        if {![regexp {&lt;span class=\"watch-view-count \" &gt;(.*?)&lt;/span&gt;} $data "" views]} { set views "0" }set views [string trim $views]set added [string trimleft $added]if {[regexp -nocase {&lt;meta itemprop=\"duration\" content=\"(.*?)\"&gt;.*} $data match duration]} {  set youtubelength $duration   if {[regexp {M(.*?)S} $duration match duration]} {     set videosecs $duration  }   set duration $youtubelength   if {[regexp {PT(.*?)M} $duration match duration]} {     set videomins $duration  } set totalseconds [expr {($videomins * 60) + $videosecs}]           set duration [clock format $totalseconds -format {%H:%M:%S}] }regexp -- {&lt;div id=\"watch7-user-header\" class=\"spf-nolink\"&gt;(.*?)&lt;div class=\"yt-dialog hid\"&gt;} $data -&gt; userinfo        if {![regexp {data-name=\"watch\"&gt;(.*?)&lt;/a&gt;} $userinfo "" author]} { set author "Unknown" }        if {![regexp {&lt;span class=\"likes-count\"&gt;(.*?)&lt;/span&gt;} $data "" likes]} { set likes "0" }        if {![regexp {&lt;span class=\"dislikes-count\"&gt;(.*?)&lt;/span&gt;} $data "" dislikes]} { set dislikes "0" }         regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" description        regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $views "" views        if {$description eq ""} {            set description "This video doesn't have any description ..."        }set description_parsed [url_search 100 07 "style_ul" $description]        set output [string map [list "&lt;title&gt;" $title_parsed "&lt;author&gt;" $author "&lt;added&gt;" $added "&lt;views&gt;" $views "&lt;duration&gt;" $duration "&lt;likes&gt;" $likes "&lt;dislikes&gt;" $dislikes "&lt;description&gt;" $description_parsed] $ourtubeXTRA(output)]        set output [utfdecode $output]return [encoding convertto utf-8 $output]}putlog "\002\00304,00You\00300,04Tube\017 \00311:: \002\00300*Loaded* \002\00315ourtubeXTRA 1.0 by \002WazzaUK\002\00311 :: \00315based on ourtube by \002Hackemate\002."set ourtubeXTRA(Loaded) 1</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Sun Jan 12, 2014 11:49 am</p><hr />
]]></content>
	</entry>
	</feed>
