Advertisement
illpastethat

TLDR talon

Aug 4th, 2013
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.00 KB | None | 0 0
  1. the referenced tldr.txt file contains data like the following:
  2. text=lots of text here
  3. with line returns too
  4. and it ends.&title=the title
  5.  
  6. alias qpack return $regsubex($1-,/(\W)/g,$iif(\t !isin `~ !^*()-_\|{}[]"'<>.,% $+ $base($asc(\t),10,16,2),$iif(\t = $chr(32),+,\t)))
  7. alias tldr {
  8.   sockopen -e tldr textteaser.p.mashape.com 443
  9. }
  10. on *:sockopen:tldr*:{
  11.   var %x sockwrite -n $sockname
  12.   %x POST /api HTTP/1.1
  13.   %x Host: textteaser.p.mashape.com
  14.   bread tldr.txt 1 $file(tldr.txt).size &f
  15.   var %uri $qpack($bvar(&f,1-).text)
  16.   %x Content-Length: $len(%uri)
  17.   %x X-Mashape-Authorization: eEEEv3NMeEvUiZiOOjX3Y6Jt9YgwizK2
  18.   %x
  19.   %x %uri
  20. }
  21.  
  22. on *:sockread:tldr*:{
  23.   if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }
  24.   else {
  25.     sockread &t
  26.     echo -a $bvar(&t,1-).text
  27.     var %pos $bfind(&t,1,{"id)
  28.     var %pos2 $bfind(&t,%pos,"]})
  29.     if (%pos2 != 0) {
  30.       var %sockreader $bvar(&t,$+(%pos,-,$calc(%pos2 + 1))).text
  31.       echo -a %sockreader
  32.       sockclose $sockname
  33.     }
  34.   }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement