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

	<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>2015-10-02T18:42:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2015-10-02T18:42:23-04:00</updated>

		<published>2015-10-02T18:42:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104490#p104490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104490#p104490"/>
		<title type="html"><![CDATA[https / tls / full API support...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104490#p104490"><![CDATA[
When i wrote that code i didnt have tls compiled. I use 'Eggdrop 1.8.0 pre-init' ( has tls support ) now. I think i will go back and sort that... The code atm works with the API part - best way to process the comments. Since the public search procedure doesnt use the API its broken since google changed the return data ( im tired of fixing all the regex). Im thinking of writing a new version from scratch using just native API - its so much simpler. Well i suppose thats the point. When i look at that code now im rather ashamed its so untidy... I dont usually like to sing googles praises but they made things alot easier by adding the API...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7928">WazzaUK</a> — Fri Oct 02, 2015 6:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arkadio]]></name></author>
		<updated>2014-05-27T23:08:13-04:00</updated>

		<published>2014-05-27T23:08:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102854#p102854</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102854#p102854"/>
		<title type="html"><![CDATA[ourtubeXTRA new version using YT API... including comments]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102854#p102854"><![CDATA[
<blockquote class="uncited"><div>bind pubm - *<a href="http://www.youtube.com/watch" class="postlink">http://www.youtube.com/watch</a>?* ourtubeXTRA::otPub </div></blockquote>It's not binding https that seems to be the default protocol for Youtube now.<br><br>Your code looks very very ugly.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12311">arkadio</a> — Tue May 27, 2014 11:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bunnybump]]></name></author>
		<updated>2014-04-23T02:55:43-04:00</updated>

		<published>2014-04-23T02:55:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102765#p102765</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102765#p102765"/>
		<title type="html"><![CDATA[ourtubeXTRA new version using YT API... including comments]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102765#p102765"><![CDATA[
uhm..another version of ourtubeXTRA made by you. i just wanna ask you one question:<br><br>"have you test it on your eggdrop before you post this script in here?"<br><br>cause i don't wanna wasting my time just for an experimently script. AFAIK, if somebody made a post of a script in here, that means it already tested and works fine to everyone (<em class="text-italics">if another user got a trouble by the script, it is not because of the creator but it is because of their own mistake</em>).<br><br>thankyou for your kind to answering my question, WazzaUK <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12060">bunnybump</a> — Wed Apr 23, 2014 2:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WazzaUK]]></name></author>
		<updated>2014-04-06T15:59:06-04:00</updated>

		<published>2014-04-06T15:59:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102727#p102727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102727#p102727"/>
		<title type="html"><![CDATA[ourtubeXTRA new version using YT API... including comments]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102727#p102727"><![CDATA[
THis version works, has ALOT of addititions.... including comments and badges.....<br><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 seperator "\002\00310•\002 "        set outputline "$youtubelogo $seperator\002\00309&lt;title&gt; $seperator\00312Author: \00314\002&lt;author&gt; $seperator\00312\002Added: \00314\002&lt;added&gt; $seperator \00312\002Views: \00314\002&lt;views&gt; $seperator\00312\002Duration: \00314\002&lt;duration&gt; $seperator\00312\002Likes: \00309\002&lt;likes&gt; $seperator\00312\002Dislikes:  \00304\002&lt;dislikes&gt; $seperator\00312\002&lt;badgelist&gt; "set descrline "\017\00314&lt;full_description&gt;"          set outputsearch " \00310\002&lt;vcount&gt; \00312\037&lt;link&gt;\003\037 $seperator\00309&lt;title&gt;\002 $seperator\00312\002Author: \00314\002&lt;author&gt; $seperator\00312\002Added:  \00314\002&lt;added&gt; $seperator\00312\002Views: \00314\002&lt;views&gt; $seperator\00312\002Duration: \00314\002&lt;duration&gt; $seperator\00312\002&lt;badgelist&gt;\017\00314&lt;description&gt;"set outputcomments "\00314\002&lt;commentnum&gt; \00312&lt;content&gt; \00314(Posted by \002&lt;author&gt;\002 on &lt;date&gt; &lt;time&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 5set max_comments 3if {$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 newword ""set oldword ""set 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 idx 0set urlindex [string first $wprotocol $word $idx ]set newword [string range $word $urlindex [string length $word]]incr idxset oldlen [expr [string first $wprotocol $newword 0] -1 ]set oldword [string range $word 0 $oldlen]             incr iset wprotocol ""if { $urlindex &gt; 0 } { append oldword " " }regexp {(f|ht)tp(s|)://} $newword "" wprotocolif { $wprotocol != "" } {     set word "$oldword\003${color}${style_bd}${style_ul}$newword\00314${style_bd}${style_ul}"append newtext $word " "}} if {( $urlindex == -1 ) &amp;&amp; ( $word != "" )} {append newtext $word " "}}set newtext [ string trimright $newtext $word ]set Linelen [ string length $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&amp;star; \u2605 &amp;lwarr; \u21e6 &amp;rwarr; \u21e8 &amp;blbt; \u25C0 &amp;brbt; \u25b6 &amp;brpdt; \u23e9 &amp;blpdt; \u23eaÒ \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 otdisplaylines {chan text} {#Display resultsset otoutput [encoding convertto utf-8 $text]        foreach line $otoutput {putquick "PRIVMSG $chan :$line"        }    }proc otYouTubeComments {VideoID otoutput} {global ourtubeXTRA::max_comments ourtubeXTRA::youtubelogputlog "otYouTubeComments - videoID: $VideoID - max_comments: $max_comments"set url "http://gdata.youtube.com/feeds/api/videos/$VideoID/comments"putlog "otYouTubeComments - URL: $url"        set token [http::geturl $url]        upvar #0 $token state        set data $state(body)        set ncode ""        regexp {[0-9]{3}} $state(http) ncode        if {$ncode eq ""} {        set ncode $state(http)        }http::cleanup $token        regsub -all {\n|\t|\r} $data "" dataset totalcomments ""regexp {&lt;openSearch:totalResults&gt;(.*?)&lt;/openSearch:totalResults&gt;} $data "" totalcommentsregsub {(.*?)&lt;/id&gt;} $data "" dataset comments [ regexp -all -inline {&lt;/id&gt;(.*?)&lt;/author&gt;} $data ]set comments_items [ expr { [ llength $comments ] /2} ]if { $ourtubeXTRA::max_comments &gt; $totalcomments } {set totalcomments $comments_items}putlog "comments contains $comments_items"set lmap ""set numcomments 0lappend otoutput ""foreach {id comment} $comments {                        foreach {entity number} [regexp -all -inline {&amp;#(\d+);} $comment] {                           lappend map $entity [format \\u%04x [scan $number %d]]}set comment [string map [subst -nocomm -novar $lmap] $comment]set commenttitle ""set commentauthor ""set commentcontent ""set commentdate ""set commenttime ""set replycount 0regexp {&lt;author&gt;&lt;name&gt;(.*?)&lt;/name&gt;} $comment "" commentauthorregexp {&lt;published&gt;(.*?)T(.*?).000Z&lt;/published&gt;} $comment "" commentdate commenttimeregexp {&lt;updated&gt;(.*?)T(.*?).000Z&lt;/updated&gt;} $comment "" commentdate commenttimeregexp {&lt;title type='text'&gt;(.*?)&lt;/title&gt;} $comment "" commenttitleregexp {&lt;content type='text'&gt;(.*?)&lt;/content&gt;} $comment "" commentcontentregexp {&lt;yt:replyCount&gt;(.*?)&lt;/yt:replyCount&gt;} $comment "" replycountputlog "rc: $replycount."set comlen [string length $commentcontent]if {($comlen == 0 ) &amp;&amp; ($replycount &gt;0)} {set commentcontent "$replycount replies on Google+"}incr numcommentsset numtext "\00312\[$numcomments\]\002"set testline [string map [list "&lt;commentnum&gt;" $numtext "&lt;content&gt;" "" "&lt;author&gt;" $commentauthor "&lt;date&gt;" $commentdate "&lt;time&gt;" $commenttime]  ${ourtubeXTRA::outputcomments} ]set predlen [expr { [string length $testline] + [string length $commentcontent] } ]if { $predlen &gt;= 380 } {set commentcontent [string range $commentcontent 0 [expr { 380 - [string length $testline] } ] ]} if {$commentcontent == "" } { set commentcontent "Empty." }set clen [string length $commentcontent]set commentcontent [url_search $clen "07" "style_ul" $commentcontent]set outputline [string map [list "&lt;commentnum&gt;" $numtext "&lt;content&gt;" $commentcontent "&lt;author&gt;" $commentauthor "&lt;date&gt;" $commentdate "&lt;time&gt;"  $commenttime] ${ourtubeXTRA::outputcomments} ]set outputline [encoding convertfrom utf-8 $outputline]set outputline [utfdecode $outputline]lappend otoutput $outputlineif {$numcomments &gt;= $ourtubeXTRA::max_comments} {break}}if { $numcomments &gt; 0 } {set totalsline "\00312Showing \00312$numcomments\00312 of \00312$totalcomments \00312comment(s)."lappend otoutput $totalsline}return $otoutput}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} \002\00304&amp;star; \00300$chan has this command disabled. \00304&amp;star;"}if {[matchattr $hand n]} {putquick "NOTICE $nick :You can enable it directly typing: /msg $chan !youtube enable"}return        }global ourtubeXTRA::ytrest protection ourtubeXTRA::youtubelogoset data ""        #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]lappend data [ utfdecode "$youtubelogo \002\00304&amp;star; \00300Flood protection triggered: $floodsecs second(s) remaining. \00304&amp;star;"]                        }                }        }        if {( $text eq "" ) &amp;&amp; ([string length $data] == 0 )} {                lappend data [ utfdecode "$youtubelogo \002\00304&amp;star; \00300Usage: !youtube &lt;search criteria&gt; \00304&amp;star;"]                       }if {( [string length $text] &lt;= 3) &amp;&amp; ([string length $data] == 0 )} {                lappend data [ utfdecode "$youtubelogo \002\00304&amp;star; \00300Error - Search parameter '$text' is too short. \00304&amp;star;"]}if {[string length $data] == 0} {        set data [ourtubeXTRAGet $text $chan]       }       if {[string length $data] == 0} {lappend data [ utfdecode "youtubelogo \0w02\00304&amp;star; I was unable to connect to that website. Probably I get timeout. \00304&amp;star;"]        }#Display resultsset data [encoding convertto utf-8 $data]        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; data#regsub {(.*?)&lt;ol id=\"search-results\" class=\"result-list\"&gt;} $data "" data#regsub {&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 "" dataregsub {&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 "" 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 } ]putlog "max links: $ourtubeXTRA::max_links - Total: $total"                if {$total &gt;= $ourtubeXTRA::max_links } {    set numitems $max_links} else {    set numitems $total                }set search_header ""if {$resultcount == 0} {    set numitems 0    set search_header "${ourtubeXTRA::youtubelogo} \002\00304&amp;star; \00300$uresultcount result(s) found for items matching '$ask'.  \00304&amp;star;"} else {                    set search_header "${ourtubeXTRA::youtubelogo} \002\00304&amp;star; \00300Showing $numitems of $uresultcount result(s) found for  items matching '$ask'. \00304&amp;star;"}set search_header [utfdecode $search_header]lappend ytlist $search_headerputlog "Search URL: http://www.youtube.com/results?search_query=$search&amp;sm=12"                set i 0set 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=\"rtl\"&gt;(.*?)&lt;/div&gt;} $item_info "" descriptionregexp {&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;meta name=\"description\" content=\"(.*?)\"&gt;} $line "" descriptionregexp {&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 200]set vcount_txt "\[$vcount\]"set ytoutput [string map [list "&lt;vcount&gt;" $vcount_txt "&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]                        if { $i &gt;= $ourtubeXTRA::max_links } {                            break                        }incr i                        lappend ytlist $ytoutputincr vcount}}return $ytlist}"404" {        http::cleanup $token                return [ utfdecode "$youtubelogO \002\00304&amp;star; \00300No such file or webpage. \00304&amp;star;"]        }            default {                http::cleanup $token                return [ utfdecode "$youtubelogo \002\00304&amp;star; \00300unforeseen circumstance. Server responded: $ncode \00304&amp;star;"]            }}    }     proc otPub {nick uhost hand chan text} {if {![channel get $chan ourtubeXTRA]} {            return        }global ourtubeXTRA::ytrest ourtubeXTRA::youtubelogo protectionset data ""        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]lappend data [utfdecode "$youtubelogo \002\00304&amp;star; \00300Flood protection triggered: $floodsecs second(s) remaining. \00304&amp;star;"]            }            set protection [clock seconds]if {[string length $data] == 0} {            set data [otGet $webTarget]}            if {[string length $data] == 0} {                lappend data [ utfdecode "$youtubelogo \002\00304&amp;star; \00300I was not able to reach Youtube's link. Probably I get a timeout. Try again.  \00304&amp;star;"]           }set data [encoding convertto utf-8 $data]foreach line $data {            putquick "PRIVMSG $chan :$line"}            utimer $ytrest [list set protection ""]        }}     proc otGet {web} {global ourtubeXTRA::youtubelogo        set token [http::geturl $web]        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                        lappend otoutput "$youtubelogo \002\00304&amp;star; \00300Invalid youtube link: $ncode \00304&amp;star;"return [utfdecode $otoutput]                    }                }            }"303" {                http::cleanup $token                lappend otoutput "$youtubelogo \002\00304&amp;star; \00300That video does not exists. Server responded: $ncode \00304&amp;star;"return [utfdecode $otoutput]            }            "404" {                http::cleanup $token                lappend otoutput "$youtubelogo \002\00304&amp;star; \00300$ncode - $web - No such webpage \00304&amp;star;"return [utfdecode $otoutput]            }            default {                http::cleanup $tokenif {[string first "Disabled" $data 0] == -1} {putlog "$VideoID: $data"}                lappend otoutput "$youtubelogo \002\00304&amp;star; \00300unforeseen circumstances. Server responded: $ncode \00304&amp;star;"return [utfdecode $otoutput]            }} set durationfmt "%M:%S"set badges ""set badge1 ""set badge2 ""set agestrict ""set title ""set title_parsed ""set VideoID ""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]}regexp {&lt;meta itemprop=\"videoId\" content=\"(.*?)\"&gt;} $data "" VideoIDputlog "videoID: $VideoID"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 "" descriptionregexp -- {&lt;p id=\"eow-description\" &gt;(.*?)&lt;/p&gt;} $data -&gt; full_description#regexp -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_descriptionregsub -all -- {(&lt;[^&gt;]*&gt;)|\" \"|&lt;/*&gt;} $full_description " " full_description #set full_description [ string replace full_description [ string first \""\" $full_description 0 ] end " " ]set tlen [string length $full_description]#set full_description_parsed [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 $full_description ]set full_description_parsed [url_search $tlen "07" "style_ul" $full_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]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 ] ${ourtubeXTRA::outputline} ]set descr [ string map [list "&lt;full_description&gt;" $full_description_parsed ] ${ourtubeXTRA::descrline} ]set ot_output ""lappend ot_output $yt_outputlappend ot_output $descrset VideoID [string trimleft $VideoID "/"]set ot_output [otYouTubeComments $VideoID $ot_output]set ot_output [utfdecode $ot_output]return $ot_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> — Sun Apr 06, 2014 3:59 pm</p><hr />
]]></content>
	</entry>
	</feed>
