Code in ourTube.tcl, Line 215:
Code: Select all
foreach {id line} $videos {
set map {}
foreach {entity number} [regexp -all -inline {&#(\d+);} $line] {
lappend map $entity [format \\u%04x [scan $number %d]]
}
set line [string map [subst -nocomm -novar $map] $line]
regexp {<img title="(.*?)"} $line "" title
regsub -all -- {\<[^\>]*\>|\t} $title "" title
regexp {<div class="video-time">(.*?)</span>} $line "" time
regsub -all -- {\<[^\>]*\>|\t} $time "" time
regexp {class="video-description">(.*?)</div>} $line "" description
regsub -all -- {\<[^\>]*\>|\t} $description "" description
regexp {<button class="master-sprite ratingVS ratingVS-(.*?)"} $line "" rating
regexp {class="video-date-added">(.*?)</span>} $line "" added
regexp {class="video-view-count">(.*?)</span>} $line "" views
regexp {<span class="video-username">(.*?)</a>} $line "" author
regsub -all -- {\<[^\>]*\>|\t} $author "" author
regexp {<a id="video-url-(.*?)"} $line "" link
set link "http://youtube.com/watch?v=$link"
set output [string map [list "<link>" $link "<time>" $time "<added>" $added "<title>" $title "<author>" $author "<description>" $description "<views>" $views "<rating>" $rating] $ourtube(outputsearch)]
lappend list $output
if {$i > $ourtube(max)} {
break
}
incr i
}
return $list
Code: Select all
<div id="watch-views-div">
<span id="watch-views"><span id="watch-view-count">8,779</span> views</span>
</div>
http://www.egghelp.org/cgi-bin/tcl_arch ... ad&id=1594
Thank You.