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

	<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>2013-05-05T16:00:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[neocharles]]></name></author>
		<updated>2013-05-05T16:00:46-04:00</updated>

		<published>2013-05-05T16:00:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101465#p101465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101465#p101465"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101465#p101465"><![CDATA[
Is this working (the etube script) properly?  A bit of it doesn't seem to show up when I try to read the code.. so was not sure.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12227">neocharles</a> — Sun May 05, 2013 4:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2012-12-23T17:48:37-04:00</updated>

		<published>2012-12-23T17:48:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100485#p100485</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100485#p100485"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100485#p100485"><![CDATA[
I update my etube.tcl script<br>You can download it here: <a href="http://www.egghelp.ru/download.php?id=647" class="postlink">http://www.egghelp.ru/download.php?id=647</a><br>Waiting for your comments and suggestions.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Sun Dec 23, 2012 5:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2012-07-31T09:59:11-04:00</updated>

		<published>2012-07-31T09:59:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99808#p99808</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99808#p99808"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99808#p99808"><![CDATA[
And dont forget about <em class="text-italics">.chanset #chan +etube</em><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Tue Jul 31, 2012 9:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2012-07-31T02:45:16-04:00</updated>

		<published>2012-07-31T02:45:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99807#p99807</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99807#p99807"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99807#p99807"><![CDATA[
etube.tcl works fine:<br><blockquote class="uncited"><div>[10:44:27]rp-f<a href="http://www.youtube.com/watch?v=VuteWrK4Nr0" class="postlink">http://www.youtube.com/watch?v=VuteWrK4Nr0</a><br>[10:44:29]lamestbotЧайка ест голубя/Seagull eats pigeon (22) by Redving(24.09.2011) Cat: Животные, Tags: чайка, голубь, съела, seagull, dove, eats, pigeon, Views: 1912. Likes/Dislikes: 8/2.<br>[10:44:29]lamestbotНа площади Сан-Марко в Венеции./San-Marco square in Venice.<br>[10:44:29]lamestbotTop comment: Ooooh,? how romantic!!! by ( 8 ч. назад ). (39.66ms.)</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Tue Jul 31, 2012 2:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nash]]></name></author>
		<updated>2012-07-30T15:10:02-04:00</updated>

		<published>2012-07-30T15:10:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99803#p99803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99803#p99803"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99803#p99803"><![CDATA[
Sorry for bumping this old thread but is there an updated version of this script available?<br>So far i'ved tried:<br><br>youtubeURL<br>youtube_title<br>youtube_checker<br>ourtube<br>etube<br><br>and (if they even work), they only show the name of the youtube video.<br>No length, views, author .. etc <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>It's getting a bit frustrating trying to find a working youtube script with "some" options in it.<br><br>Halp!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12042">Nash</a> — Mon Jul 30, 2012 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2011-11-27T13:09:08-04:00</updated>

		<published>2011-11-27T13:09:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98261#p98261</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98261#p98261"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98261#p98261"><![CDATA[
Try <a href="http://www.egghelp.ru/download.php?id=647" class="postlink">this</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Sun Nov 27, 2011 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[vladdeh]]></name></author>
		<updated>2011-11-25T14:15:42-04:00</updated>

		<published>2011-11-25T14:15:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98253#p98253</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98253#p98253"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98253#p98253"><![CDATA[
Script not pulling views anymore or comments, any fixes?:p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11622">vladdeh</a> — Fri Nov 25, 2011 2:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Joose]]></name></author>
		<updated>2009-11-13T18:55:52-04:00</updated>

		<published>2009-11-13T18:55:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90897#p90897</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90897#p90897"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90897#p90897"><![CDATA[
<blockquote class="uncited"><div>youtube &lt;title&gt; tags are now multiline causing the fail.<br><br>I set it to use the meta tag instead and made some other fixes</div></blockquote>Or just add this:<div class="codebox"><p>Code: </p><pre><code>Add this line in to the script:set title [string map {"\n" " "} $title]Before these lines:*snip*set title [string map {"\n" " "} $title]set title "$relocation $title"set title [string trim $title]*snip*</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10947">Joose</a> — Fri Nov 13, 2009 6:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pogue]]></name></author>
		<updated>2009-11-07T12:10:26-04:00</updated>

		<published>2009-11-07T12:10:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90831#p90831</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90831#p90831"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90831#p90831"><![CDATA[
<blockquote class="uncited"><div>youtube &lt;title&gt; tags are now multiline causing the fail.<br><br>I set it to use the meta tag instead and made some other fixes</div></blockquote>Thank you, that fixed the problem!<br><br>However, I still can't get it to properly display the number of views, ratings, or a description - although the last comment works properly.  I went back in and added back in speechles' modifications and still no change.  The !youtube search function doesn't appear to do anything either.<br><br>Did Youtube change their meta tags?  I am not fluent in TCL, so I'm getting pretty lost, but the things I am noticing some variation in the regexp when it is pulling the data off the youtube site.  I'm assuming it is getting one part for the <strong class="text-strong">!youtube</strong> search feature and the other for when a URL is pasted into the channel.  But, they are different for each.<br><br><em class="text-italics">Note: I am using the line numbers from the appended code posted by anotheregglover above.  I am using the Youtube video <a href="http://www.youtube.com/watch?v=305vRNoofr8" class="postlink">Afroman - Because I Got High (Uncensored)</a> as an example for the Youtube source.</em><br><ol style="list-style-type:decimal"><li>Line 225 &amp; 349 both seem to try grab the description.</li>  <li>Line 228 &amp; 351 appear to be both for the ratings.</li> <li>Line 230 &amp; 350 appear to both be getting the view count</li></ol><strong class="text-strong">Description</strong><br>Line 225: <div class="codebox"><p>Code: </p><pre><code>regexp {class="video-description"&gt;(.*?)&lt;/div&gt;} $line "" description</code></pre></div>Line 349: <div class="codebox"><p>Code: </p><pre><code>regexp {&lt;meta name="description" content="(.*?)"&gt;.*} $data "" description</code></pre></div>Youtube source: <div class="codebox"><p>Code: </p><pre><code>&lt;meta name="description" content="Afroman - Because I Got High (Uncensored)"&gt;</code></pre></div><strong class="text-strong">Ratings</strong><br>Line 228: <div class="codebox"><p>Code: </p><pre><code>regexp {&lt;button class="master-sprite ratingL ratingL-(.*?)"} $line "" rating</code></pre></div>Line 351: <div class="codebox"><p>Code: </p><pre><code>regexp {&lt;div id="defaultRatingMessage"&gt;(.*?)&lt;/span&gt;.*} $data "" rating</code></pre></div>Youtube source: <div class="codebox"><p>Code: </p><pre><code>&lt;div id="defaultRatingMessage"&gt;&lt;span class="smallText"&gt;36,010 ratings&lt;/span&gt;</code></pre></div><strong class="text-strong">Views</strong><br>Line 230: <div class="codebox"><p>Code: </p><pre><code>regexp {class="watch-view-count"&gt;(.*?)&lt;/span&gt;} $line "" views</code></pre></div>Line 350: <div class="codebox"><p>Code: </p><pre><code>regexp {class="watch-view-count"&gt;(.*?)&lt;/span&gt;} $line "" views</code></pre></div>Youtube source: <div class="codebox"><p>Code: </p><pre><code>&lt;span id="watch-view-count"&gt;12,163,389&lt;/span&gt;</code></pre></div>Currently, the output of the script when pasting the URL for the afroman video within the eggdrop console looks like this:<br><div class="codebox"><p>Code: </p><pre><code>[12:37] ourTube: Getting http://www.youtube.com/watch?v=305vRNoofr8 ... from pogue on #bodybuilding.com[12:37] ourTube: Afroman - Because I Got High (Uncensored). (by ssabmudaru) no views, no rating. Last comment: &lt;woody0900 (40 minutes ago)&gt; had afeeling. lol...</code></pre></div>But, as you can see, only the regexp for the view count is the same, yet it still doesn't appear to be displaying the view count at all and defaults to "no views".  So, it appears to me (at least from my point of view) that there are some errors in this script in the way that it is grabbing data off of the Youtube page that need to be addressed.<br><br>Any additional help is appreciated!  Thanks,<br>pogue<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10663">pogue</a> — Sat Nov 07, 2009 12:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[anotheregglover]]></name></author>
		<updated>2009-11-07T10:47:54-04:00</updated>

		<published>2009-11-07T10:47:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90830#p90830</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90830#p90830"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90830#p90830"><![CDATA[
youtube &lt;title&gt; tags are now multiline causing the fail.<br><br>I set it to use the meta tag instead and made some other fixes<br><br><div class="codebox"><p>Code: </p><pre><code>## ourTube.tcl 1.0.2 --# This file search the web target and show relevant information about.# Is posible define a YouTube account and the bot will log in. Useful# when the link are for adult people i.e. It will show the first link# that finds in a whole phrase.## Copyright (c) 2007-2009 Eggdrop Spain 12-april-2009#   HackeMate (Sentencia) Sentencia@eggdrop.es## This program is free software; you can redistribute it and/or# modify it _only for your own use_## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  ## Please, use the email to contact with the author for let him know about all# what you could do. Everyone wants develop his software as well.##                   Thank you for feed my empiric life.## If you like, you can contact with the author to suggest him features. By the# way, do not ask him to make Login, he is working on that.# This is what you need to get this script work:# Type in partyline: .chanset #channel +ourtube# Changelog:#   Fixes:#       Resolved Tcl error [otPub]: can't read "views": no such variable#       Resolved eternal ignore-protection  issue##   Added features:#       Now will forward to new location 302 http code received when pasting#       http://youtube. links#       Explicit message when 404 error (not found)#       All non 200, 302, 303, 404 errors will stop the procedure showing proper reason#       -*- IMPORTANT -*-#       Auto Update checker: You can verify if your ourTube copy is the lastest#       version available typing .ourtube update in partyline##       FeedBack feature. Type in partyline .ourtube feedback [your email] &lt;message&gt;#       to send the author any suggestion or comment. Insults are not welcome.##       Added seacher, !youtube string and it will return matches#       it is customizable (configure ourtube(outputsearch))setudef flag ourtubesetudef flag ourtubecolorsglobal ourtube tcl_platform# (1) Enable or (0) disable colorsset ourtube(colors) 1# Flood Protection: after show a link, will ignore all links few seconds# This means 1 link per 10 seconds.set ourtube(rest) 10# What language you can receive the youTube data? (if works heh)set ourtube(lang) en# Limit of links at same timeset ourtube(max) 5# Do you want see all matches at one line? (0) Yes (1) Noset ourtube(multiline) 1# This is the final output message what you will read in your channel.#       -*- This is not for search command (only when someone pasted link)# You can configure all fields that your eggdrop will show.# &lt;title&gt;       will return the title of the video# &lt;author&gt;      It was the author himself who had uploaded the video# &lt;views&gt;       How many views the video has# &lt;rating&gt;      His rating# &lt;description&gt; Information by author - This may be disabled because it can#               contain spam# &lt;comment&gt;     Will show the last comment if exists - Same as description, take care#               with spam.set ourtube(output) "\002&lt;title&gt;\002. (by &lt;author&gt;) &lt;views&gt; views, &lt;rating&gt; rating. Last comment: &lt;comment&gt;"# This is the output message of search engine#       -*- This is only for search engine# You can configure all fields that your eggdrop will show.# &lt;link&gt;        URL video link# &lt;time&gt;        video's duration# &lt;added&gt;       since when it is on line# &lt;title&gt;       will return the title of the video# &lt;author&gt;      It was the author himself who had uploaded the video# &lt;views&gt;       How many views the video has# &lt;rating&gt;      His rating# &lt;description&gt; Information by author - This may be disabled because it can#               contain spamset ourtube(outputsearch) "\00312\037&lt;link&gt;\003\037 \00315\(&lt;time&gt; rating: &lt;rating&gt;\)\003 \"\0036&lt;title&gt; \0031&lt;author&gt; said\0036: &lt;description&gt;\003\" &lt;views&gt;,  added &lt;added&gt;"# Do you want auto update this file when it is possible?# (1) Yes (0) No - It is recommended, if youtube changes his tags probably this script will brokeset ourtube(autoupdate) 0# This is not required to edit, or yes.set ourtube(author) "HackeMate"set ourtube(contact) "HackeMate &lt;Sentencia@eggdrop.es&gt;"set ourtube(name) "ourTube"set ourtube(fileName) [info script]set ourtube(projectName) "ourTube"set ourtube(version) "1.0.1"set ourtube(package.http) [package require http]set ourtube(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); $ourtube(lang); rv:1.9.0.3) ourTube 1.0" -accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"bind pub - !youtube otYoutubeproc otYoutube {nick uhost hand chan text} {        if {![channel get $chan ourtube]} {if {$text eq "enable"} {channel set $chan +ourtube            channel set $chan +ourtubecolorsotLog $chan "Usage: !youtube &lt;search string&gt; To see a list of matches."putserv "NOTICE $nick :You also can use .ourtube update and .ourtube feedback in partyline to upgrade your script or send a feedback to author of this script."return} else {putserv "NOTICE $nick :$chan has this command disabled."}if {[matchattr $hand n]} {putserv "NOTICE $nick :You can enable it directly typing: /msg $chan !youtube enable"}        return    }    regsub -all -- {\017|\002|\037|\026|\003(\d{1,2})?(,\d{1,2})?} $text "" argglobal ourtube# This is a generic protection to prevent flood ourtube.com    # No utimer required#if {![info exists ourtube(protection)]} {set ourtube(protection) [clock seconds]} else {if {![string is digit -strict $ourtube(protection)]} {set ourtube(protection) [clock seconds]} else {set time [expr [clock seconds]-$ourtube(protection)]if {$time &gt;= $ourtube(rest)} {set ourtube(protection) [clock seconds]} else {otLog log "Flood protection in $chan from $nick\."return}}}if {$arg eq ""} {putserv "NOTICE $nick :Tell me what to search."return}    set data [ourtubeGet $arg]        if {![channel get $chan ourtubecolors]} {regsub -all -- {\017|\002|\037|\026|\003(\d{1,2})?(,\d{1,2})?} $data "" data}if {[string length $data] == 0} {set data "I was unable to connect to that website. Probably I get timeout."        return}if {$ourtube(multiline) != "1"} {putserv "PRIVMSG $chan :$data"} else {foreach line $data {putserv "PRIVMSG $chan :$line"}}    }proc ourtubeGet {ask} {        global ourtube    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 -timeout 10000]    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" {            set videos [regexp -all -inline {&lt;div class="video-entry"&gt;(.*?)&lt;div class="video-clear-list-left"&gt;&lt;/div&gt;} $data]            set total [expr [llength $videos] /2]            if {$total &gt; $ourtube(max)} {                set list [list "Showing $ourtube(max) of $total."]            }            set i 2            set title ""            set description ""            set rating ""            set added ""            set views ""            set author ""            set link ""            foreach {id line} $videos {                set map {}                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 {&lt;img title="(.*?)"} $line "" title                regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" title                regexp {&lt;div class="video-time"&gt;(.*?)&lt;/a&gt;} $line "" time                regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $time "" time                regexp {class="video-description"&gt;(.*?)&lt;/div&gt;} $line "" description                #regexp {"description"&gt;(.*?)&lt;/div&gt;} $line "" description                regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" description                regexp {&lt;button class="master-sprite ratingL ratingL-(.*?)"} $line "" rating                regexp {class="watch-video-added"&gt;(.*?)&lt;/span&gt;} $line "" added                regexp {class="watch-view-count"&gt;(.*?)&lt;/span&gt;} $line "" views                regexp {&lt;span class="video-username"&gt;(.*?)&lt;/a&gt;} $line "" author                regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $author "" author                regexp {&lt;a id="video-url-(.*?)"} $line "" link                set link "http://youtube.com/watch?v=$link"                set output [string map [list "&lt;link&gt;" $link "&lt;time&gt;" $time "&lt;added&gt;" $added "&lt;title&gt;" $title "&lt;author&gt;" $author "&lt;description&gt;" $description "&lt;views&gt;" $views "&lt;rating&gt;" $rating] $ourtube(outputsearch)]                lappend list $output                if {$i &gt; $ourtube(max)} {                    break                }                incr i            }            return $list        }        "404" {            otLog log "No such file or webpage."            http::cleanup $token            return [list "No such file or webpage."]        }        default {            otLog log "unforeseen circumstance. Server responded: $ncode"            http::cleanup $token            return [list "unforeseen circumstance. Server responded: $ncode"]        }    }    }bind pubm - * otPubproc otPub {nick uhost hand chan text} {        if {![channel get $chan ourtube]} {        return    }    global ourtube    regsub -all -- {\017|\002|\037|\026|\003(\d{1,2})?(,\d{1,2})?} $text "" arg        set webTarget [lsearch -inline [split $arg] {*http://*.youtube.*/watch?*}]    if {([info exists ourtube(protection)]) &amp;&amp; ([string is digit -strict $ourtube(protection)])} {        set rest [expr [clock seconds]-$ourtube(protection)]        if {$rest &gt;= $ourtube(rest)} {            set ourtube(protection) ""        }    } else {        set ourtube(protection) ""    }    if {$webTarget ne ""} {         if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $webTarget]} {            otLog log "Unsupported URL: $webTarget"            return         }        if {$ourtube(protection) ne ""} {            otLog "Resting... (flood protection) [duration [expr ([clock seconds]-$ourtube(protection))]] left"            return        }        set ourtube(protection) [clock seconds]        otLog log "Getting $webTarget ... from $nick on $chan"        set data [otGet $webTarget]        if {!$ourtube(colors)} {            regsub -all -- {\017|\002|\037|\026|\003(\d{1,2})?(,\d{1,2})?} $data "" data        }        if {[string length $data] == 0} {            set data "I was not able to reach Youtube's link. Probably I get a timeout. Try again."        }        otLog log "$data"        putserv "PRIVMSG $chan :$data"        utimer $ourtube(rest) [list set ourtube(protection) ""]    }}proc otGet {web {relocation ""}} {    global ourtube    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                    otLog log "$web forwards us to $value"                    return [otGet $value "(Relocated)"]                }            }        }        "303" {            otLog log "This video does not exists."            http::cleanup $token            return "That video does not exists. Server responded: $lastcode"        }        "404" {            otLog log "$web - No such webpage."            http::cleanup $token            return "$web - No such webpage"        }        default {            http::cleanup $token            otLog log "unforeseen circumstances. Server responded: $lastcode"            return "unforeseen circumstances. Server responded: $lastcode"        }    }    set data [string map {"&amp;quot\;" "\"" "&amp;amp\;quot\;" "\"" "&amp;" "&amp;"} $state(body)]     http::cleanup $token    set author ""    set description ""    set views ""    set rating ""    #regexp {&lt;title&gt;(.*)&lt;/title&gt;} $data "" title    regexp {&lt;meta name=\"title\" content=\"(.*?)\"&gt;.*} $data "" title    regexp {class="hLink fn n contributor"&gt;(.*?)&lt;/a&gt;&lt;br&gt;} $data "" author    regexp {&lt;meta name=\"description\" content=\"(.*?)\"&gt;.*} $data "" description    regexp {&lt;span id=\"watch-view-count\"&gt;(.*?)&lt;/span&gt;} $data "" views    regexp {&lt;div id=\"defaultRatingMessage\"&gt;(.*?)&lt;/span&gt;.*} $data "" rating    # This is not so smart way. I know, sorry about :)    set comments ""    set description ""    regexp {&lt;div id="recent_comments" class="comments"&gt;(.*?)&lt;div id="div_comment_form_id} $data "" comments    if {$comments ne ""} {       regexp { rel="nofollow"&gt;(.*?)&lt;/a&gt;} $comments "" user       regexp {&lt;span class="watch-comment-time"&gt;(.*?)&lt;/span&gt;} $comments "" timeago       regexp {&lt;div class="watch-comment-body"&gt;(.*?)&lt;/div&gt;} $comments "" comment       set comment [string map {\n " " "&lt;br&gt;" ""} $comment]       regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $comment "" comment       regsub -all {\s+} $comment " " comment       set comment "\&lt;$user [string trim $timeago]\&gt; [string trim $comment]"    } else {        set comment ""    }    regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" title    regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" description    regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $views "" views    regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $rating "" rating    set rating [lindex [split $rating] 0]    set title "$relocation $title"    set title [string trim $title]    if {![string is digit -strict $views]} {        set views "no"    }    if {![string is digit -strict $rating]} {        set rating "no"    }    if {$comment eq ""} {        set comment "This video doesn't have any comments until now"    }    if {$description eq ""} {        set description "This video doesn't have any description"    }    set output [string map [list "&lt;title&gt;" $title "&lt;author&gt;" $author "&lt;description&gt;" $description "&lt;views&gt;" $views "&lt;rating&gt;" $rating "&lt;comment&gt;" $comment] $ourtube(output)]    return $output}# upvar #0 $token stateproc otLog {target string} {    global ourtube    if {![validchan $target]} {        putlog "$ourtube(name)\: $string"    } else {        putserv "PRIVMSG $target :$ourtube(name)\: $string"    }}bind dcc n ourtube communication::welcomenamespace eval communication {# communication.tcl --# This is a little library for eggdrop as internal use# It is done to portablility - You cannot use it without a file.cgi in your# http server. If you really want that, contact me.variable version 1.0variable feedback {http://www.eggdrop.es/cgi-bin/feedback.cgi}variable update {http://www.eggdrop.es/cgi-bin/update.cgi}proc welcome {hand ipx text} {global ourtubeset arg [lindex [split $text] 0]switch -- $arg {"feedback" {set contact [lindex [split $text] 1]set message [join [lrange [split $text] 1 end]]if {($contact eq "") || ($message eq "")} {putdcc $ipx "$ourtube(projectName) - FeedBack"putdcc $ipx "Thank you for tell what you think."putdcc $ipx "This command sends to author an message with your suggestion, you are able to send one feedback per day (aprox)"putdcc $ipx "Usage: .webfeedback &lt;your email (put it if you may want a reply or conversation with author, if not, put anything)&gt; &lt;tell me in english or spanish what you want say&gt;"} else {set result [[namespace current]::Feedback $contact $ourtube(projectName) $message]if {$result eq ""} {putdcc $ipx "The server responded nothing. Did you sent a previous feedback already?"return}putdcc $ipx "The server responded:"foreach line [split $result \n] {putdcc $ipx $line}}}"update" {set download [lindex [split $text] 1]putdcc $ipx [join [lrange [split [[namespace current]::Update $ourtube(fileName) $ourtube(projectName) $ourtube(version) $download]] 1 end]]}default {putdcc $ipx "You can use '.ourtube update' to verify the last version and '.ourtube feedback' to send to author a suggestion"}}}proc Feedback {reporter projectName message} {variable feedbackhttp::config -useragent "$reporter $projectName"set token [http::geturl "$feedback\?suggest=[http::formatQuery $message]" -timeout 4000]set data [http::data $token]http::cleanup $tokenreturn $data}proc Update {fileName projectName version {download ""}} {variable updateset fs [open $fileName]set data [read $fs]close $fsset md5 [md5 $data]set query [http::formatQuery project $projectName version $version md5 $md5 download $download]set token [http::geturl "$update\?$query" -timeout 4000]set data [http::data $token]http::cleanup $token        set result ""        set info ""        set url ""regexp {&lt;!-- result --&gt;(.*?)&lt;!-- /result --&gt;} $data "" resultregexp {&lt;!-- info --&gt;(.*?)&lt;!-- /info --&gt;} $data "" infoif {($download ne "") &amp;&amp; ($download ne "no") &amp;&amp; ($result == 1)} {regexp {&lt;!-- data --&gt;(.*?)&lt;!-- /data --&gt;} $data "" urlif {![regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url]} {return "0 Invalid URL target file link."}set token [http::geturl $url -binary 1 -timeout 4000]set fileData [http::data $token]            file rename -force -- $fileName $fileName\.bakset fs [open $fileName w]puts -nonewline $fs $fileDataclose $fs            catch {source $fileName}set info "$projectName was (purged) downloaded and sourced succesfully, now you are using the lastest version available. There is a backup in $fileName\.bak"        }return "$result $info"}}if {![info exists ourtube(loaded)]} {    if {$ourtube(autoupdate) == "1"} {        set ourtube(status) [communication::Update $ourtube(fileName) $ourtube(projectName) $ourtube(version) $ourtube(autoupdate)]        set ourtube(result) [lindex [split $ourtube(status)] 0]        set ourtube(info) [join [lrange [split $ourtube(status)] 1 end]]        otLog log $ourtube(info)    }} otLog log "[file tail $ourtube(fileName)] $ourtube(version) Loaded - by $ourtube(author) (Feedback and update commands available, type .ourtube in partyline)"set ourtube(loaded) 1</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5886">anotheregglover</a> — Sat Nov 07, 2009 10:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pogue]]></name></author>
		<updated>2009-11-05T05:38:31-04:00</updated>

		<published>2009-11-05T05:38:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90802#p90802</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90802#p90802"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90802#p90802"><![CDATA[
I am having some trouble with this script out of the blue.  In the main channel, the bot will only say "Youtube" when a script is posted, but in the bots console it says the whole bit.<br><br>However, the descriptions still is saying that there is no description found.<br><br>I've copied the code I'm using, updated from speechles and rrc55 (Thanks to both of you) to pastebin.<br><br><a href="http://pastebin.com/f2987e2f6" class="postlink">http://pastebin.com/f2987e2f6</a><br><br>IRC:<br><br>[03:33am] &lt;~pogue&gt; <a href="http://www.youtube.com/watch?v=ahihGKZC5Kk" class="postlink">http://www.youtube.com/watch?v=ahihGKZC5Kk</a><br>[03:33am] &lt;+BodyBuildingBot&gt; YouTube<br><br>Console:<br><br>[04:33] ourTube: Getting <a href="http://www.youtube.com/watch?v=ahihGKZC5Kk" class="postlink">http://www.youtube.com/watch?v=ahihGKZC5Kk</a> ... from pogue on #bodybuilding.com<br>[04:33] ourTube: YouTube<br>- The Dangers of Colloidal Silver. (by pogue972) 207,396 views, 282 rating. Description: This video doesn't have any description<br><br>I'm a little baffled as to why this is happening, it was working fine previously and I can't see any configuration options that would limit its output.  When I look over it, it seems like it's breaking after the first word, but I can't see why...<br><br>Thoughts?<br><br>Thanks in advance,<br>pogue<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10663">pogue</a> — Thu Nov 05, 2009 5:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-09-11T15:59:52-04:00</updated>

		<published>2009-09-11T15:59:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90220#p90220</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90220#p90220"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90220#p90220"><![CDATA[
<blockquote class="uncited"><div>I can't get this script to pull descriptions off Youtube either, but it will get the comments okay.<br><blockquote class="uncited"><div>You are a scholar and a gentleman.</div></blockquote>I sent you a PM.<br><br>Thanks</div></blockquote>To properly get descriptions, change this:<div class="codebox"><p>Code: </p><pre><code>regexp {class="video-description"&gt;(.*?)&lt;/div&gt;} $line "" description </code></pre></div>Into this:<div class="codebox"><p>Code: </p><pre><code>regexp {description"&gt;(.*?)&lt;/div&gt;} $line "" description </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Sep 11, 2009 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pogue]]></name></author>
		<updated>2009-09-11T08:45:38-04:00</updated>

		<published>2009-09-11T08:45:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90209#p90209</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90209#p90209"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90209#p90209"><![CDATA[
I can't get this script to pull descriptions off Youtube either, but it will get the comments okay.<br><blockquote class="uncited"><div>You are a scholar and a gentleman.</div></blockquote>I sent you a PM.<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10663">pogue</a> — Fri Sep 11, 2009 8:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rrc55]]></name></author>
		<updated>2009-09-09T02:27:30-04:00</updated>

		<published>2009-09-09T02:27:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90190#p90190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90190#p90190"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90190#p90190"><![CDATA[
You are a scholar and a gentleman.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10533">rrc55</a> — Wed Sep 09, 2009 2:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-09-09T00:37:41-04:00</updated>

		<published>2009-09-09T00:37:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90189#p90189</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90189#p90189"/>
		<title type="html"><![CDATA[Help Updating ourTube.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90189#p90189"><![CDATA[
<blockquote class="uncited"><div>Actually I think these are the relevant lines.<br><div class="codebox"><p>Code: </p><pre><code>regexp {&lt;span id="watch-view-count"&gt;(.*?)&lt;/span&gt;} $data "" views</code></pre></div><div class="codebox"><p>Code: </p><pre><code>regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $views "" views</code></pre></div><div class="codebox"><p>Code: </p><pre><code>    if {![string is digit -strict $views]} {        set views "no"    }</code></pre></div></div></blockquote>Your closer than you think. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><blockquote class="uncited"><div>&lt;speechles&gt; !webby <a href="http://youtube.com/watch?v=ADBTHpk0L8g" class="postlink">http://youtube.com/watch?v=ADBTHpk0L8g</a> --regexp &lt;span id="watch-view-count"&gt;(.*?)&lt;/span&gt;-- --nostrip<br>&lt;sp33chy&gt; <strong class="text-strong">regexp</strong>: capture1 ( 155,195 )</div></blockquote>It's the comma causing the problem, it of course is not a digit and this part:<div class="codebox"><p>Code: </p><pre><code>    if {![string is digit -strict $views]} {        set views "no"    }</code></pre></div>Should be removed.. and this part slightly changed...<div class="codebox"><p>Code: </p><pre><code>change: regexp {&lt;span id="watch-view-count"&gt;(.*?)&lt;/span&gt;} $data "" viewsinto: if {![regexp {&lt;span id="watch-view-count"&gt;(.*?)&lt;/span&gt;} $data "" views]} { set views "no" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Sep 09, 2009 12:37 am</p><hr />
]]></content>
	</entry>
	</feed>
