Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on $*:TEXT:/^[~!@\.^]tiny(url)? ./i:#: {
- sockclose TinyURL
- set %TinyURL# $chan
- set %TinyURL /api-create.php?url= $+ $regsubex($1,/([`@#$%^&+=\[\]{}\\|;'",<>\/?])/g,% $+ $base($asc(\t),10,16))
- sockopen TinyURL tinyurl.com 80
- }
- on *:SOCKOPEN:TinyURL: {
- sockwrite -n TinyURL GET %TinyURL HTTP/1.1
- sockwrite -n TinyURL Host: tinyurl.com
- sockwrite TinyURL $crlf
- }
- on *:SOCKREAD:TinyURL: {
- var %T
- sockread %T
- while ($sockbr) {
- if (http://tinyurl.com/ isin %T) {
- msg %TinyURL# %T
- unset %TinyURL*
- sockclose TinyURL
- return
- }
- sockread %T
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement