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

	<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>2012-06-06T13:31:27-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-06-05T07:08:55-04:00</updated>

		<published>2012-06-05T07:08:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99547#p99547</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99547#p99547"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99547#p99547"><![CDATA[
All done!<br><br>working as it should<br><div class="codebox"><p>Code: </p><pre><code>package require TclCurlbind pub - !addinfo pub:addinfoproc pub:addinfo {nick uhost hand chan text} {    if {[scan $text {%s%s%s} release url filename] != 3} {      puthelp "Usage: !addinfo &lt;release&gt; &lt;url&gt; &lt;filename&gt;"       return    }   exec mkdir "/home/bot/1/filesys/info/$release"   set curlHandle [curl::init]  $curlHandle configure -url $url -file "/home/bot/1/filesys/info/$release/$filename"  $curlHandle perform}putlog "Reciever StoreiNfo.tcl - Loaded By Fire-Fox"</code></pre></div>UPDATE:<br><br>now it stores the release to database (it has a "Timer for the mysql connection" aswell)<br><div class="codebox"><p>Code: </p><pre><code>##################### Mysql path #####################load /usr/lib/tcltk/mysqltcl-3.05/libmysqltcl3.05.so# define database parametersset mysql_(user) "USERNAME"set mysql_(password) "PASSWORD"set mysql_(host) "localhost"set mysql_(database) "bots"set mysql_(table) "TABLE"if {![info exists mysql_(handle)]} {set mysql_(handle) [mysqlconnect -host $mysql_(host) -user $mysql_(user) -password $mysql_(password) -db $mysql_(database)]}package require TclCurlbind pub - !addinfo pub:addinfoproc pub:addnfo {nick uhost hand chan text} { global mysql_   if {[scan $text {%s%s%s} rlsname url filename] != 3} {      puthelp "Usage: !addinfo &lt;release&gt; &lt;url&gt; &lt;filename&gt;"       return    }   exec mkdir "/home/bot/1/filesys/nfo/$release"   set curlHandle [curl::init]  $curlHandle configure -url $url -file "/home/bot/1/filesys/info/$rlsname/$filename"  $curlHandle perform#TESTset infofp [open "/home/bot/1/filesys/info/$release/$filename" "r"]set rawinfo [read $infofp]close $infofp#ENDputlog "$rawinfo"set escapedinfo [mysql::escape $mysql_(handle) $rawinfo]  set nix [mysqlexec $mysql_(handle) "INSERT INTO $mysql_(table) (release,filename,rawinfo) VALUES ( '$release' , '$filename' , '$escapednfo' )"]}putlog "Reciever StoreNfoToDB.tcl - Loaded By Fire-Fox"######################################### Timer for the mysql connection #########################################if {[timerexists nfo:dbconnection] !=""} { killtimer $dbconnect(dbtimer) }set dbconnect(dbtimer) [timer 1 info:dbconnection]proc info:dbconnection {} {global mysql_ dbconnectif {[catch  {mysqlping $mysql_(handle)}] != 0} {          set mysql_(handle) [mysqlconnect -host $mysql_(host) -user $mysql_(user) -password $mysql_(password) -db $mysql_(database)]}if {[set var [timerexists info:dbconnection]] !="" } { killtimer $var }set dbconnect(dbtimer) [timer 1 info:dbconnection]}putlog "Reciever StoreiNfo.tcl - Loaded By Fire-Fox" </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Tue Jun 05, 2012 7:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2012-06-05T00:20:00-04:00</updated>

		<published>2012-06-05T00:20:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99542#p99542</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99542#p99542"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99542#p99542"><![CDATA[
Then drop the:<div class="codebox"><p>Code: </p><pre><code>   foreach line [split $content \n] {      puts $fp [join $line "\n"]   } </code></pre></div>and make it:<div class="codebox"><p>Code: </p><pre><code>puts $fp $content</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jun 05, 2012 12:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-06-04T17:16:58-04:00</updated>

		<published>2012-06-04T17:16:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99536#p99536</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99536#p99536"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99536#p99536"><![CDATA[
Thanks speechles <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>All sortet out! \o/<br><br>There is just one thing, the text is placed on new line all the line, how can i put it it should be a copy of the original file, to the file i store.<br><br>There will proberly come some acsii aswell how do i handle that...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Mon Jun 04, 2012 5:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2012-06-04T17:12:41-04:00</updated>

		<published>2012-06-04T17:12:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99535#p99535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99535#p99535"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99535#p99535"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !addinfo pub:addinfo </code></pre></div>Fix it like that instead, the pubm bind passes text very differently. Differently as in, the trigger is included at the front of your text. Literally everything you type is passed to the procedure. The variable $::lastbind contains your pubm mask. This means your filenames or the url it attempts to fetch will contain "!addinfo" in them.<br><br>Using pub, $::lastbind will contain the trigger, and the rest of the text is passed to the procedure. This eliminates the trigger from the text passed and your filenames/urls come out correct now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jun 04, 2012 5:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-06-04T17:17:50-04:00</updated>

		<published>2012-06-04T17:00:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99533#p99533</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99533#p99533"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99533#p99533"><![CDATA[
I'll try it right away, and post the output<br><br> i get this : <div class="codebox"><p>Code: </p><pre><code>[wrong # args: should be "bind type flags cmd/mask ?procname?"]</code></pre></div>EDIT: fixed by doing : <div class="codebox"><p>Code: </p><pre><code>bind pubm - "*!addinfo*" pub:addinfo </code></pre></div>NEW ERROR:<br><div class="codebox"><p>Code: </p><pre><code>Tcl error [pub:addinfo]: could't open socket: host is unreachable (Name or service not known)</code></pre></div>i can download from the url... but not the bot<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Mon Jun 04, 2012 5:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2012-06-05T00:14:10-04:00</updated>

		<published>2012-06-04T15:40:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99531#p99531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99531#p99531"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99531#p99531"><![CDATA[
Haven't tested this.<div class="codebox"><p>Code: </p><pre><code>bind pub - !addinfo pub:addinfoproc pub:addinfo {nick uhost hand chan text} {if {[scan $text {%s%s} file url] != 2} {puthelp "Usage: !addinfo &lt;file&gt; &lt;url&gt;"return}set token [::http::geturl $url]set content [::http::data $token]::http::cleanup $contentset fp [open "/home/$file" "w"]foreach line [split $content \n] {puts $fp [join $line "\n"]}close $fp}</code></pre></div>Edit: fixed typo.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jun 04, 2012 3:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-06-06T13:31:27-04:00</updated>

		<published>2012-06-04T13:12:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99528#p99528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99528#p99528"/>
		<title type="html"><![CDATA[[SOLVED][Request] add text from url link to mysqldatabase]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99528#p99528"><![CDATA[
Hey!<br><br>I looking for a script that can do the following :<br><br>When a user types !addinfo some.text.here <a href="http://url.com/get/?a=info&amp;id=1710031&amp;bot=DB2" class="postlink">http://url.com/get/?a=info&amp;id=1710031&amp;bot=DB2</a>  (were the info is stored) the script should then, download the text file to /home/information.<br><br>some.text.here should be the saved name of the filename to...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Mon Jun 04, 2012 1:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
