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

	<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>2009-11-05T21:06:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-11-05T21:06:20-04:00</updated>

		<published>2009-11-05T21:06:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90807#p90807</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90807#p90807"/>
		<title type="html"><![CDATA[Re: Adding multiple commands to Exec]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90807#p90807"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#put the line below at the very top of your scriptpackage require http# then change your code to look like this   if {![string match "http://*" $i]} { set i "http://$i" }   catch {set http [::http::geturl "$i" -timeout 5000]} error   if {![string match -nocase "::http::*" $error]} {     putserv "privmsg $chan :[string totitle [string map {"\n" " | "} $error]] \( $i \)"     return 0   }   if {![string equal -nocase [::http::status $http] "ok"]} {     putserv "privmsg $chan :[string totitle [::http::status $http]] \( $i \)"     return 0   }   set html [::http::data $http]   ::http::cleanup   if {![regexp -nocase -- {&lt;title&gt;(.*?)&lt;title&gt;} $html - title]} { set title "No Title Found" }   set fd [open $urllogfile a+]   puts $fd "$i;[ctime [unixtime]];$title;$nick;$chan"   close $fd</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Nov 05, 2009 9:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cquilliam]]></name></author>
		<updated>2009-11-05T10:56:34-04:00</updated>

		<published>2009-11-05T10:56:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90803#p90803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90803#p90803"/>
		<title type="html"><![CDATA[Adding multiple commands to Exec]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90803#p90803"><![CDATA[
I am trying to create a url catcher for my eggdrop that not only stores the url, but also grabs the title of the page.  Now, I have been able to achieve this goal by having tcl call an external bash script of the follow:<br><br>the tcl part:<div class="codebox"><p>Code: </p><pre><code>  set fd [open $urllogfile a+]  set title [exec gettitle.sh $i]  puts $fd "$i;[ctime [unixtime]];$title;$nick;$chan"  close $fd</code></pre></div>the bash part:<div class="codebox"><p>Code: </p><pre><code>#!/bin/shTITLE=`lynx -source $1 | grep -i "&lt;title&gt;" | awk -F "&lt;title&gt;" '{print $2}' | awk -F "&lt;/title&gt;" '{print $1}'`if [ "$TITLE" = "" ]; then  echo No Title Foundelse  echo $TITLEfi</code></pre></div>Now, while this is working, it is messy to call an external script like this, so, I was wondering if it was possible to translate this into TCL so its all in the same script?  <br><br>Thanks in advance for any help or tips.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10939">cquilliam</a> — Thu Nov 05, 2009 10:56 am</p><hr />
]]></content>
	</entry>
	</feed>
