Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On *:input: {
- if (($1 == !noparsetitle) || ($1 == !noparse) || ($1 == !dontparsetitle) || ($1 == !noparsetitles) || ($1 == !dontparsetitles)) {
- set %dontparsetitles $addtok(%dontparsetitles,$2-,44)
- echo -ac info I wont be parsing for the website title $2- anymore...
- }
- elseif ($1 == !nolinks) {
- set %nolinks $addtok(%nolinks,$iif(($2),$2,$active),44)
- echo -ac info I wont be parsing links from $iif(($2),$2,$active) anymore...
- }
- }
- on *:TEXT:*:#: {
- if (!$istok(%nolinks,$nick,44)) {
- rtc $chan $1-
- }
- }
- on *:ACTION:*:#: rtc $chan $1-
- on *:sockopen:website.*: {
- if (!$sockerr) {
- tokenize 32 $($+(%,$sockname),2)
- sockwrite -n $sockname GET $2 HTTP/1.1
- sockwrite -n $sockname Host: $1
- sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
- sockwrite -n $sockname Accept: */*
- sockwrite -n $sockname Connection: Close
- sockwrite -n $sockname $crlf
- }
- else unset $+(%,$sockname)
- }
- on *:sockread:website.*: {
- var %x, %z = $sockname, %e = $($+(%,%z),2)
- sockread -f %x
- if ($regex(%x,/<title[\w\s="]*>(.*?)<\/title>/i)) {
- tokenize 32 %e
- var %s = $btc(Url:) $+(http://,$+($1,$iif($2 != /,$2))) - $btc(Title:) $ptc($regml(1)) $iif($4,$4)
- if ((!$istok(%dontparsetitles,$ptc($regml(1)),44)) && (*powerbot.org/vb/showthread.php?t=* !iswm $+(http://,$+($1,$iif($2 != /,$2))))) {
- echo -a 12[4 $+ $3 $+ 12]10 $iif(c isincs $chan($3).mode,$strip(%s),%s) 12By4 %urlnick 10on12 %urlnetwork
- }
- unset $+(%,$(%z,2))
- .sockclose %z
- }
- if (*HTTP*302* iswm %x) set -e %web.tmp 1
- if (Location: isin %x) {
- if ($mtc(%x)) {
- tokenize 32 %e
- sockclose %z
- soc $regml(web,1) $iif($regml(web,2),$v1,/) $iif($3,$3,1) %z $iif(%web.tmp,Redirected)
- unset %web.tmp
- }
- }
- }
- on *:sockclose:website.*: unset $+(%,$sockname)
- alias -l soc {
- var %x = $iif($4,$4,$+(website.,$r(a,z),$r(a,z),$r(a,z),$r(0,9),$r(0,9),$r(0,9)))
- set -e $+(%,%x) $1-2 $iif($3 ischan && $me ison $3,$3) $iif($5,$ntc($5))
- sockopen %x $1 80
- }
- alias -l mtc return $regex(web,$1,/(?:https?:\/\/)?((?:www\.)?[\w-.]+\.(?>[a-z]{2,4})(?![a-z]))([\w-_#?=%.\/&?]+)?/ig)
- alias -l ptc return $replacecs($1,—,-,",",&,&,<,<,>,>,�,$chr(233),�,$chr(231),ç,$chr(231),ñ,$chr(241),�,$chr(209),�,$chr(220),�,$chr(244))
- alias -l btc return $+($chr(2),$1,$chr(2))
- alias -l ntc return $+($chr(40),$1,$chr(41))
- alias rtc {
- if (*youtube.com* !iswm $1-) {
- if ($mtc($2-)) && (!%website.flood [ $+ [ $regml(web,1) ] ]) {
- set %urlnick $nick
- set %urlnetwork $network
- var %x = 1, %v
- while ($regml(web,%x)) {
- var %z = $iif(/ isin $regml(web,$calc(%x +1)),$v2,/), %i = $regml(web,%x)
- if (/ !isin %i) && (!$istok(%v,%i,32)) {
- soc %i %z $1
- %v = %v %i
- }
- inc %x 1
- }
- set -eu5 %website.flood $+ $regml(web,1) 1
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement