rendered paste bodydialog pbu {
title "Pastebin uploader"
size -1 -1 328 253
option dbu
combo 2, 13 4 69 72, size drop
edit "", 1, 14 56 293 182, multi return autohs autovs
box "Files to pastebin / on pastebin", 3, 5 43 314 205
button "Paste it!", 4, 104 14 51 19
button "Read from a Site!", 5, 174 15 51 19
edit "URL", 6, 236 5 72 10, read
edit "Status", 7, 236 18 72 10, read
link "My site.", 8, 237 33 70 8
}
on *:dialog:pbu:init:0:{
did -a pbu 2 www.pastebin.ca
did -a pbu 2 www.pastebin.com
did -a pbu 2 www.paste.stirk.org
did -a pbu 2 www.paste2.org
did -a pbu 2 www.putnote.net
did -a pbu 2 www.pastecode.net
}
alias pb dialog -md pbu pbu
on *:dialog:pbu:sclick:4,5:{
clipboard $null
sockopen $iif($did == 4,pasting,reading) $did(2) 80
var %x = 1
clipboard -a content=
while ($did(1,%x)) {
clipboard -a $iif($cb(0),%0D%0A $+ $urlencode($did(1,%x)),$urlencode($did(1,%x)))
inc %x
}
}
on *:sockopen:*ing:{
sockwrite -nt $sockname $iif(sockname == reading,GET $gettok($did(pbu,6),2,47),POST $chr(47)) HTTP/1.1
sockwrite -nt $sockname Host: $did(pbu,2)
if ($sockname == pasting) {
sockwrite -nt $sockname Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
sockwrite -nt $sockname Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
sockwrite -nt $sockname Accept-Encoding: gzip,deflate
sockwrite -nt $sockname Accept-Language: nl,en-us;q=0.7,en;q=0.3
sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -nt $sockname Content-Length: $cb(0).len
sockwrite -nt $sockname $crlf $cb
}
}
on *:sockread:*ing:{ $event %read
echo %read
}