tglogo.png

1 LIKES

Snippet


SS Uploader (Imageshack)

In Category General IRC Posted by Haggis On 08/15/12

This will take a screens hot of your current desktop and upload it to imageshack
alias /share {
    %sharing_file = $1-
  %tempsockname = imageshack_drone $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
  sockopen %tempsockname www.imageshack.us 80
  sockmark %tempsockname filename= $+ %sharing_file
}
on 1:sockopen:imageshack_drone*:{

  bset -t &postdata 1 -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="uploadtype" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) on $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="fileupload"; filename=" $+ $nopath($gettok($mid($sock($sockname).mark,11),1,59)) $+ " $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Type: image/jpeg $+ $crlf $+ $crlf

  bread " $+ $gettok($mid($sock($sockname).mark,10),1,59) $+ " 0 $file($gettok($mid($sock($sockname).mark,10),1,59)).size &file_contents
  bcopy &postdata $calc($bvar(&postdata,0) + 1) &file_contents 1 -1
  bset -t &postdata $calc($bvar(&postdata,0) + 1) $crlf $+ -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="url" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) paste image url here $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="email" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="MAX_FILE_SIZE" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 13145728 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="refer" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) http://imageshack.us/ $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="brand" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="optsize" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 320x320 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410--

  sockwrite -nt $sockname POST / HTTP/1.1
  sockwrite -nt $sockname Host: imageshack.us
  sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ko; rv:1.9.0.10) Gecko/2009042316 Frefox/3.0.5
  sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  sockwrite -nt $sockname Accept-Language: en-us,en;q=0.8,ko-kr;q=0.5,ko;q=0.3
  sockwrite -nt $sockname Accept-Charset: EUC-KR,utf-8;q=0.7,*;q=0.7
  sockwrite -nt $sockname Keep-Alive: 1200
  sockwrite -nt $sockname Connection: keep-alive
  sockwrite -nt $sockname Referer: http://imageshack.us/?no_multi=1
  sockwrite -nt $sockname Content-Type: multipart/form-data; boundary=---------------------------18762165517410
  sockwrite -nt $sockname Content-Length: $bvar(&postdata,0) $+ $crlf $+ $crlf
  sockwrite $sockname &postdata
}

on 1:sockread:imageshack_drone*:{
  sockread -f %lol
  if $mid(%lol,1,9) = location: {

    %lol = $mid(%lol,11)
echo -a 4Uploaded to imageshack: http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))

    set %link http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))
    unset %lol

  }

}


Comments 2

Haggis - Monday, 20 August, 2012
I suppose you could If you can shorten it let me know as i cant see how it could be
Jess - Thursday, 16 August, 2012
Very cool, I would likely either use a loacl variable or alias to shorten some of the code.