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

	<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-12-30T13:53:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2011-12-30T13:53:41-04:00</updated>

		<published>2011-12-30T13:53:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98439#p98439</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98439#p98439"/>
		<title type="html"><![CDATA[Store Images]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98439#p98439"><![CDATA[
Any chance for an improvement for that script?<br><br>That it resizes images way too big to a default size?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Dec 30, 2011 1:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2011-12-30T09:03:46-04:00</updated>

		<published>2011-12-30T09:03:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98438#p98438</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98438#p98438"/>
		<title type="html"><![CDATA[Store Images]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98438#p98438"><![CDATA[
hey username, thanks a lot for your help, it works great!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Dec 30, 2011 9:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2011-12-26T09:46:24-04:00</updated>

		<published>2011-12-26T09:46:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98426#p98426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98426#p98426"/>
		<title type="html"><![CDATA[Store Images]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98426#p98426"><![CDATA[
It based on this: <a href="http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=939" class="postlink">http://www.egghelp.org/cgi-bin/tcl_arch ... oad&amp;id=939</a> , My and Drilly`s modifications.<br><div class="codebox"><p>Code: </p><pre><code>set piccheck(version) "0.1"set filePath /var/www/pictures.htmlbind pub - !plast urlshowproc urlshow {nick ushost hand chan text} {global filePath    set file [open $filePath r]    set data [read $file]    close $file    putlog [llength [split $data \n]]    set plast [string map {&lt;br&gt; "" &lt;b&gt; "\002" &lt;/b&gt; "\002" "&lt;img src=\"" "\00312\037" "\"&gt;" "\037"} [lindex [split $data \n] [expr [llength [split $data \n]]-2]]]    putserv "PRIVMSG $chan :Last picture: $plast"}bind pubm - * urlchecksetudef flag piccheckproc urlcheck { nick uhost hand chan str } {global piccheckset urlcheck(ext) {       jpg       jpe       jpeg       gif       png}if {![regexp {((?:http://|www\.)+[^ ]+)} $str str]} { return 0 }set extension ""       set wlink $str       regsub -all -- {(http://)+} $str "" str       regexp {(www.)?[A-z|0-9|\-|\.|\_]*\.[A-z]{2,3}} $str host       regexp {[/]+(.)*} $str url       regexp {[A-z]{3,4}$} $str extension       set ispic 0       foreach i $urlcheck(ext) {               if {[string match -nocase $extension $i]} {                       set ispic 1               }       }       if {$ispic != 1} { return 0 }       set linecheck "[getdata $host $url $chan]"       putlog "-- $linecheck"       set ispic 0       if {[string match -nocase *error* $linecheck]} { putserv "PRIVMSG $chan :\002Error:\002 $linecheck. \002Not a picture.\002"; set ispic 1 }       if {[string match -nocase "*&lt;html&gt;*" $linecheck]} { putserv "PRIVMSG $chan :\002Error:\002 $linecheck. \002Not a picture.\002"; set ispic 1 }       #putlog $linecheck       global filePath       set file [open $filePath r]       set data [read $file]       close $file       set already 0;       foreach line [split $data \n] {           if { [string match -nocase "*$wlink*" "$line"] == 1 } {               catch {unset data}               set already 1               putserv "PRIVMSG $chan :\002$nick\002, your link already exists."           }       }       if { $ispic == 0 &amp;&amp; $already == 0 } {              set file [open $filePath "a"]              puts $file "&lt;br&gt;&lt;b&gt;Added by $nick at [time] [date]&lt;b&gt;&lt;br&gt; \&lt;img src=\"$wlink\"\&gt;&lt;br&gt;"              close $fileputserv "PRIVMSG $chan :\002$nick\002, your link already in base."       }}proc getdata { host url chan } {global sock               if {[string match "*error*" [open_socket $host $url $chan]]} { return "error"}               gets $sock line               if {[string match -nocase "*HTTP/1.? 301 Moved*" $line]} {                       while {![eof $sock]} {                               gets $sock line                               if {[string match -nocase "*Location*" $line]} {                                       set url [lindex [split $line] 1]                                       regsub -all -- {(http://)+} $url "" url                                       regexp {[/]+(.)*} $url url                                       close $sock                                       open_socket $host $url $chan                                       gets $sock line                                       break                               }                       }               }               if {![string match "HTTP/1.? 200 OK" $line]} { close $sock;return "error($line)" }               set msg ""               while {(![eof $sock]) &amp;&amp; ([string length $line] != 0)} {                       gets $sock line                       if {[string match -nocase *server* $line]} {regsub -all -- "Server" $line "\002Server\002" line; append msg $line }                       if {[string match -nocase *date* $line]} {regsub -all -- "Date" $line "\002Date\002" line; append msg ", " $line }                       if {[string match -nocase *content*type* $line]} {                            if {![string match -nocase "*image/*" "$line"]} {                           close $sock                           return error                           }                       regsub -all -- "Content-Type" $line "\002Content-Type\002" line; append msg ", " $line                       }                       if {[string match -nocase *content*length* $line]} {regsub -all -- "Content-Length" $line "\002Content-Length\002" line; append msg ", " $line }                       if {[string match -nocase *connection* $line]} {regsub -all -- "Connection" $line "\002Connection\002" line; append msg ", " $line }                       if {[string match -nocase *keep*alive* $line]} {regsub -all -- "Keep-Alive" $line "\002Keep-Alive\002" line; append msg ", " $line }                       if {[string match -nocase *expires* $line]} {regsub -all -- "Expires" $line "\002Expires\002" line; append msg ", " $line }                       if {[string match -nocase *cache*control* $line]} {regsub -all -- "Cache-Control" $line "\002Cache-Control\002" line; append msg ", " $line }                       if {[string match -nocase *accept*ranges* $line]} {regsub -all -- "Accept-Ranges" $line "\002Accept-Ranges\002" line; append msg ", " $line }               }               gets $sock line               close $sockputserv "PRIVMSG $chan :[string trim [join [append msg "."]] ", "]"return $line}proc open_socket { host url chan } {global sock#putlog "Host: $host - url : $url"       if {[catch {set sock [socket [string map -nocase {www. ""} $host] 80] } sockerror]} {               putserv "PRIVMSG $chan: \002Error:\002 $sockerror"               return "error: $sockerror"       } else {               puts $sock "GET $url HTTP/1.1"               puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"               puts $sock "Accept :*/*"               puts $sock "Host: $host"               puts $sock ""               flush $sock       }}putlog "Drilly's Picture-URL-Saver $piccheck(version) loaded..."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Mon Dec 26, 2011 9:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2011-12-23T12:40:11-04:00</updated>

		<published>2011-12-23T12:40:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98423#p98423</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98423#p98423"/>
		<title type="html"><![CDATA[Store Images]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98423#p98423"><![CDATA[
Hey,<br><br>I need a script that will store links to .jpg, .bmp, .gif files, into a txt file (will make sure theres no duplicates, meaning won't save the same link twice) and then when someone types !image it will randomly paste a link to the channel.<br><br>Of course the script must have protections so people can't flood and the bot won't quit due to flood.<br><br>* When the image displayed its displayed with a number, such as 'Image #55: <a href="http://www" class="postlink">http://www</a>....'<br><br>Then you can also !erase 55 to remove it<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Fri Dec 23, 2011 12:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
