SCRIPT ID: PASTEBIN
This script announces new mIRC Pastes in Pastebin.com
You can make it work in 3 simple steps.
IMPORTANT NOTE: pastebin.com stops access if the requests are done too fast because they want people to use their API! But their API doesn't support archive's listing which i need for this script! So don't change the seconds in the timer because you are likely to be denied access for some time and the script will be stuck as the socket will not close...!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;|Pastebin New mIRC Pastes Announcer|;;;;;;;;;;;;;;
;;;|Script by OrFeAsGr - humanity.ucoz.com|;;;;;;;;;;;;
;;;;;;|Visit this site for more mIRC Scripts|;;;;;;;;;;
;;;;;;;;;;;;;;;;|And mIRC Help|;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;v0.1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;http://hawkee.com/snippet/17096/;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ON *:SOCKREAD:*: {
if ($sockname == pastebin) {
if (!%PASTEBINversion) || (%PASTEBINversion != v0.1) { set %PASTEBINversion v0.1 }
if ($sockerr) { msg $pastebinchan Error While Looking Up pastebin.com/archive/mirc | sockclose $sockname }
var %pastebin
sockread %pastebin
;echo -at %pastebin
if (!%pbget) {
if (*td><img src="* iswm %pastebin) {
if ($gettok(%pastebin,7,34) != %lpastebin) {
set -u5 %pbnew 1
set %lpastebin $v1
set %pbflink $+(http://pastebin.com,$v1)
set %pbtitle $gettok($gettok(%pastebin,4,62),1,60)
}
elseif ($gettok(%pastebin,7,34) == %lpastebin) {
sockclose $sockname
}
}
if (*td>* iswm %pastebin) && (*ago* iswm %pastebin) {
if (%pbnew) {
set %pbtime $gettok($gettok(%pastebin,2,62),1,60)
sockclose $sockname
set %pbget 1
sockopen pastebin www.pastebin.com 80
}
}
}
elseif (%pbget) {
if (*img src="/i/t.gif" class="img_line t_us"* iswm %pastebin) { set %pbuser $gettok(%pastebin,2,62) }
if (*img src="/i/t.gif" class="img_line t_vi"* iswm %pastebin) { set %pbvisits $gettok(%pastebin,2,62) }
if (*img src="/i/t.gif" class="img_line t_ex"* iswm %pastebin) { set %pbexpire $gettok(%pastebin,2,62) }
if (*span class="h_640">* iswm %pastebin) { set %pbsize $gettok(%pastebin,5,62)
msg $pastebinchan 0,12Pastebin New Paste 12Title: %pbtitle 12Time: %pbtime 12by: %pbuser 12Size: %pbsize 12Expires: %pbexpire 12Visits: %pbvisits 12Link: %pbflink
}
if (*textarea* iswm %pastebin) { set %rawcoll $addtok(%rawcoll,$gettok(%pastebin,2,62),32) }
if (%rawcoll) && (*textarea* !iswm %pastebin) {
inc %rawlines 1
if (%rawlines <= 2) {
set %rawcoll $addtok(%rawcoll,%pastebin,32)
}
elseif (%rawlines > 2) {
unset %rawlines
msg $pastebinchan 12Post: $+(%rawcoll,[...])
unset %rawcoll
sockclose $sockname
unset %pbget
}
}
}
}
}
ON *:SOCKOPEN:*: {
if ($sockname == pastebin) {
if ($sockerr) { msg $pastebinchan Error While Looking Up pastebin.com/archive/mirc | sockclose $sockname }
if (!%pbget) {
sockwrite -nt $sockname GET /archive/mirc HTTP/1.1
}
elseif (%pbget) {
sockwrite -nt $sockname GET %lpastebin HTTP/1.1
}
sockwrite -nt $sockname Host: pastebin.com
sockwrite $sockname $crlf
}
}
alias pastebin { .timerpastebin 0 200 sockopen pastebin pastebin.com 80 }
alias pastebinchan { return #CHANNEL_NAME_HERE }
Or do you want to donate some bucks because you like my scripts??? Visit https://www.paypal.me/OrFeAsGr
Thx! ^_^
I'm soon going to try and make a link shortener with the API of a famous link shorting site. When i do i will add it to all my scripts that are related to link posting in channels.