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

	<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>2002-04-03T15:00:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-04-03T15:00:00-04:00</updated>

		<published>2002-04-03T15:00:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=5937#p5937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=5937#p5937"/>
		<title type="html"><![CDATA[tcl error in script that picks info from html file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=5937#p5937"><![CDATA[
this script is about requesting your personal "horocope". it takes the info from a site, see in the code which one. in the code you see only the scorpio html, once the script works, i'll put the rest in it too.<br>but for some dark reason, the script does not work. the script doesn't do anything...<br>anybody some advice???<br>tnx!<br>btw, i can't put the code in <div class="codebox"><p>Code: </p><pre><code></code></pre></div> because i put some strings between [] in my code...<br><br>#!/bin/sh<br># restart using tclsh <br>bind pub - !h pub_horoscoop<br><br>proc pub_horoscoop {n u h c} {<br>exec /usr/bin/tclsh "$0" "$@"<br><br>package require http<br>putlog "&lt;&lt; $n &gt;&gt; !horoscoop!"<br>proc htmlstrip {input} {<br> set htmllen [string length $input];set pos 0;set on 1;set output ""<br> while {$pos &lt; $htmllen} {<br>  set char [string index $input $pos]<br>  if {$char == "&lt;"} {set on 0}<br>  if {$char == "&gt;"} {set on 1;set char ""}<br>  if {$on == 1} {append output $char}<br>  incr pos<br> }<br> return $output<br>}<br><br><br>set url "<a href="http://horoscope.tiscali.be/nl/scorpio.html" class="postlink">http://horoscope.tiscali.be/nl/scorpio.html</a>"<br><br>set mytoken [::http::geturl $url]<br>set pdata [::http::data $mytoken]<br>set status [::http::status $mytoken]<br>upvar #0 $mytoken state<br>set meta $state(meta)<br>set clean [::http::cleanup $mytoken]<br>set nummeta [llength $meta]<br>set cookies ""<br>for {set x 0} {$x &lt; $nummeta} {incr x} {<br> set mkey [lindex $meta $x]<br> incr x<br> set mval [string trimleft [lindex $meta $x]]<br> if {$mkey == "Set-Cookie"} {<br>  puts "mval is ($mval)"<br>  append cookies "Cookie "<br>  append cookies "$Version=1;[lindex $mval 0] "<br> }<br>}<br>set cookies [string trimright $cookies]<br>set last [string length $cookies]<br>if {[string index $cookies end] == ";"} {set cookies [string range $cookies 0 [expr $last -2]]}<br><br>#puts "cookies are ($cookies)"<br><br>if {$status == "timeout"} {puts "der is lag bij de site, probeer straks opnieuw"; exit}<br><br>regexp {&lt;br&gt;&lt;div align="JUSTIFY"&gt;&lt;font face="Arial" size="-1"&gt;([^&lt;]+)&lt;/font&gt;} $pdata a b<br><br>puts [join [split $b n]]<br><br>}<br><br>&lt;font size=-1&gt;[ This Message was edited by: Mentolboy on 2002-04-03 12:07 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Wed Apr 03, 2002 3:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
