; IRCPics Client 0.1b for mIRC, author sai at kaatajat.net ; freely distributable under GPL2 ; ; You need to define your channels that are monitored in the following way: ; ; on 1:TEXT:*:#channeltobemonitored:ircpics_parse $nick $chan $1- ; or ; on 1:TEXT:*:#mircpics:ircpics_parse $nick $chan $1- ; ; Do not change the order of parameters, because the script just wont work then ; ; By default script monitors all channels on 1:TEXT:*:#:ircpics_parse $nick $chan $1- ;DO NOT CHANGE ANYTHING BELOW THIS LINE! alias ircpics_parse { if ($regex($3-,/((\.http|\.https|\.www):\/\/[a-zA-Z0-9\|\[\]\/\\\:\?\%\.\,\&\;=#\-\_\!\+\~]*)/i)) { halt } if ($regex($3-,/(www\.[a-zA-Z0-9\/\\\:\?\%\.\,\&\;=#\-\_\!\+\~]*)/i) && $regml(1)) { ircpics_send $1 $2 http:// $+ $regml(1) } if ($regex($3-,/((http|https):\/\/[a-zA-Z0-9\|\[\]\/\\\:\?\%\.\,\&\;=#\-\_\!\+\~]*)/i) && $regml(1)) { ircpics_send $1 $2 $regml(1) } } alias ircpics_send { var %postdata = nick= $+ $1 $+ &channel= $+ $2 $+ &url= $+ $3 ircpics_http post http://ircpics.com/add.php %postdata } on *:sockopen:http.*:{ ; if (!$window(@http)) window -ek0 @http if ($sockerr) || (!$sock($sockname)) return if (/* !iswm $http.parse($hget(http,url)).path) { var %path / $+ $http.parse($hget(http,url)).path } else { var %path $http.parse($hget(http,url)).path } sockwrite -n $sockname $hget(http,method) /add.php HTTP/1.1 sockwrite -n $sockname Accept: */* sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded sockwrite -n $sockname User-Agent: mIRC $version sockwrite -n $sockname Host: $http.parse($hget(http,url)).host sockwrite -n $sockname Content-Length: $len( $hget(http,data) ) sockwrite -n $sockname Connection: Keep-Alive sockwrite -n $sockname Cache-Control: no-cache sockwrite -n $sockname if ($hget(http,method) == post) { sockwrite -n $sockname $hget(http,data) } sockwrite -n $sockname $crlf $+ $crlf } on *:sockread:http.*:{ var %http.read | sockread %http.read | tokenize 32 %http.read if (!$1) return .signal -n http $1- ; if (HTTP/1.* 200 OK iswm $1-) echo $color(info) -s HTTP $hget(http,method) request to $hget(http,url) successful! } on 1:sockclose:http.*:{ .signal -n http Connection to $sock($sockname).ip has been closed remotely } alias ircpics_http { hadd -m http url $2 hadd -m http method $upper($1) if ($3) hadd http data $3- if ($sock($+(http.,$1))) .sockclose $+(http.,$1) sockopen $+(http.,$1) $http.parse($2).host 80 } alias http.parse { return ircpics.com }