Advertisement
illpastethat

Erpk name for leal9001

Apr 6th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.29 KB | None | 0 0
  1. alias erpk {
  2.   if ($sock(erpk)) { sockclose erpk }
  3.   sockopen erpk erpk-api.com 80
  4. }
  5.  
  6. on *:sockopen:erpk:{
  7.   sockwrite -n $sockname GET /citizen/profile/2109804.json?key=fkqquQ2Y8v HTTP/1.1
  8.   sockwrite -n $sockname Host: erpk-api.com
  9.   sockwrite -n $sockname user-agent: Mozilla/??
  10.   sockwrite -n $sockname Connection: Keep-Alive
  11.   sockwrite -n $sockname $crlf
  12. }
  13. on *:sockread:erpk:{
  14.   if ($sockerr > 0) {
  15.     echo -a SOCKET ERROR: $sockerr
  16.     halt
  17.   }
  18.   sockread &t
  19.   ;at this point all of the info read from the page is held in the binary variable &t and you can view it with echo -a $bvar(&t,1-).text
  20.   var %sockreader $bvar(&t,$calc($bfind(&t,1,13 10 13 10) + 4) $+ -).text
  21.   ;this line above looks complicated is what it does is _finds_ in the bvar the location of 13,10,13,10 which is the same as two $crlf in a row
  22.   ;and two $crlf in a row is hitting enter twice (or means the actual page starts past the headers like HTTP OK and whatever
  23.   ;so now all we have to do is parse out the part that you want, in this case the ID
  24.   var %ex $gettok(%sockreader,2,44)
  25.   ;this is because NAME is in the second COMMA (which has an ascii value of 44)
  26.   var %ex $gettok(%ex,2,58)
  27.   ;this is because the actual name is after the COLON (which has an ascii value of 58)
  28.   msg #gervasio $noqt(%ex)
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement