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

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2011-07-17T15:29:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[veso]]></name></author>
		<updated>2011-07-17T15:29:28-04:00</updated>

		<published>2011-07-17T15:29:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97228#p97228</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97228#p97228"/>
		<title type="html"><![CDATA[get video title from vbox7.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97228#p97228"><![CDATA[
Can any 1 help me with this tcl i write this code but i cant get the video title <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * rss-chckurlproc rss-chckurl {n u h c t} {set zazz {http://vbox7.*/play:([A-Za-z0-9_\-]+)}if {[regexp $zazz $t match fluff video_id]} {set url "$match"szazz $url $c}}proc szazz {url c {refer ""} {cookies ""} { re 0 }} {http::config -useragent "Opera/9.80 (Windows NT 5.1; U; bg) Presto/2.6.30 Version/10.62"    # if we have cookies, let's use em ;)   if {![string length $cookies]} {      catch {set token [http::geturl $url -timeout 10000]} error   } else {      catch {set token [::http::geturl $url -headers [list "Referer" "$refer" "Cookie" "[string trim [join $cookies {;}] {;}]" ] -timeout 10000]} error   }   # error condition 1, invalid socket or other general error   if {![string match -nocase "::http::*" $error]} {      putlog "Error: [string totitle [string map {"\n" " | "} $error]] \( $url \)"      return 0   }   # error condition 2, http error   if {![string equal -nocase [::http::status $token] "ok"]} {      putlog "Http error: [string totitle [::http::status $token]] \( $url \)"      http::cleanup $token      return 0   }   upvar #0 $token state   # iterate through the meta array to grab cookies   foreach {name value} $state(meta) {      # do we have cookies?                                                                    if {[regexp -nocase ^Set-Cookie$ $name]} {         # yes, add them to cookie list                                                                lappend ourCookies [lindex [split $value {;}] 0]      }   }   # if no cookies this iteration remember cookies from last   if {![info exists ourCookies] &amp;&amp; [string length $cookies]} {      set ourCookies $cookies   }   # recursive redirect support, 300's   # the full gambit of browser support, hopefully ... ;)   if {[string match "*[http::ncode $token]*" "303|302|301" ]} {      foreach {name value} $state(meta) {         if {[regexp -nocase ^location$ $name]} {            if {![string match "http*" $value]} {               # fix our locations if needed               if {![string match "/" [string index $value 0]]} {                  set value "[join [lrange [split $url "/"] 0 2] "/"]/$value"  putlog "$value"               } else {                  set value "[join [lrange [split $url "/"] 0 2] "/"]$value"  putlog "$value"               }            }            # catch redirect to self's. There is one rule:            # A url can redirect to itself a few times to attempt to            # gain proper cookies, or referers. This is hard-coded at 2.            # We catch the 3rd time and poison our recursion with it.            # This will stop the madness ;)            if {[string match [string map {" " "%20"} $value] $url]} {               if {![info exists poison]} {                  set poison 1               } else {                  incr poison                  if {$poison &gt; 2} {                    putlog "HTTP Error: Redirect error self to self \(3rd instance poisoned\) \( $url \)"                    return                  }               }            }            # poison any nested recursion over 10 traversals deep. no legitimate            # site needs to do this. EVER!            if {[incr re] &gt; 10} {              putlog "HTTP Error: Redirect error (&gt;10 too deep) \( $url \)"              return            }            # recursive redirect by passing cookies and referer            # this is what makes it now work! :)            szazz [string map {" " "%20"} $value] $url $c $ourCookies $re            # only the last iteration from our recursion is required            # we save time by using return on prior recurses. this does            # not poison the recursion because we have invoked ourself            # before we poison the unneeded iteration.            return         }      }   }   # waaay down here, we finally check the ncode for 400 or 500 codes   if {[string match 4* [http::ncode $token]] || [string match 5* [http::ncode $token]]} {      putlog "Http resource is not evailable: [http::ncode $token] \( $url \)"      return 0   }set html [split [::http::data $token] \n]#regsub -all "\n" $html "" htmlset f [open z.db w]puts $f $htmlclose $f#if {[regexp {&lt;title&gt;(.*?)&lt;/title&gt;} $html - title]} { putquick "privmsg $c : $title" }#::http::cleanup $token}</code></pre></div>when i post the video link my bot retturn this:<br><a href="http://vbox7.com/show:missjavascript?back_to=%2Fplay%3A9b3eb2dc" class="postlink">http://vbox7.com/show:missjavascript?ba ... 3A9b3eb2dc</a><br><a href="http://vbox7.com/show:misscookie?back_to=%2Fplay%3A9b3eb2dc" class="postlink">http://vbox7.com/show:misscookie?back_t ... 3A9b3eb2dc</a><br><a href="http://vbox7.com/show:missjavascript?back_to=%2Fplay%3A9b3eb2dc" class="postlink">http://vbox7.com/show:missjavascript?ba ... 3A9b3eb2dc</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11694">veso</a> — Sun Jul 17, 2011 3:29 pm</p><hr />
]]></content>
	</entry>
	</feed>
