Advertisement
westor

BitCoins rate !BTC for Wikked

Dec 8th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.68 KB | None | 0 0
  1. ON !*:TEXT:!btc:#: { sockget $nick $chan http://finance.yahoo.com/q?s=btcusd=x }
  2.  
  3. alias sockget {
  4.   if (!$1-) { echo -ag ERROR: Enter the URL Page correctly! | return }
  5.   var %s = sockget_ $+ $rand(1,100000)
  6.   if ($sock(%s)) { sockclose %s }
  7.   var %site = $1-
  8.   var %get_host = $chr(47) $+ $gettok(%site,3-,47)
  9.   var %host = $gettok(%site,2,47)
  10.   if ($right(%site,1) == $chr(47)) && ($right(%get_host,1) !== $chr(47)) { var %get_host = %get_host $+ $chr(47) }
  11.   if (*https* iswm %site) { sockopen -e %s %host 443 }
  12.   else { sockopen %s %host 80 }
  13.   sockmark %s $1 $2 %get_host
  14. }
  15.  
  16. ON *:SOCKOPEN:sockget_*: {
  17.   if ($sockerr) { echo -ag ERROR: SOCKOPEN -> $sock($sockname).wserr -> $sock($sockname).wsmsg | return }
  18.   sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3-,32) HTTP/1.0
  19.   sockwrite -n $sockname Host: $sock($sockname).addr
  20.   sockwrite -n $sockname User-Agent: */*
  21.   sockwrite -n $sockname Connection: Close
  22.   sockwrite -nt $sockname $crlf
  23. }
  24.  
  25. ON *:SOCKREAD:sockget_*: {
  26.   if ($sockerr) { echo -ag ERROR: SOCKREAD -> $sock($sockname).wserr -> $sock($sockname).wsmsg | return }
  27.   var %read
  28.   sockread %read
  29.   if ($sockbr) {
  30.     ; echo -ag DATA: $left(%read,4096)
  31.     if (*</script><div id="yfi_broker_buttons" style="min-height* iswm %read) {
  32.       var %p = $httpstrip(%read)
  33.       var %p = $gettok(%p,1-2,58)
  34.       var %p = $remove(%p,BTC/USD (BTCUSD=X) -CCY ,Prev Close)
  35.       var %n = $gettok($sock($sockname).mark,1,32)
  36.       var %c = $gettok($sock($sockname).mark,2,32)
  37.       if ($me !ison %c) { goto end }
  38.       if (%n !ison %c) { goto end }
  39.       .msg %c [ $+ %n $+ ]: BitCoin rates are: %p
  40.       :end
  41.       sockclose $sockname
  42.       return
  43.     }
  44.   }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement