Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON !*:TEXT:!btc:#: { sockget $nick $chan http://finance.yahoo.com/q?s=btcusd=x }
- alias sockget {
- if (!$1-) { echo -ag ERROR: Enter the URL Page correctly! | return }
- var %s = sockget_ $+ $rand(1,100000)
- if ($sock(%s)) { sockclose %s }
- var %site = $1-
- var %get_host = $chr(47) $+ $gettok(%site,3-,47)
- var %host = $gettok(%site,2,47)
- if ($right(%site,1) == $chr(47)) && ($right(%get_host,1) !== $chr(47)) { var %get_host = %get_host $+ $chr(47) }
- if (*https* iswm %site) { sockopen -e %s %host 443 }
- else { sockopen %s %host 80 }
- sockmark %s $1 $2 %get_host
- }
- ON *:SOCKOPEN:sockget_*: {
- if ($sockerr) { echo -ag ERROR: SOCKOPEN -> $sock($sockname).wserr -> $sock($sockname).wsmsg | return }
- sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3-,32) HTTP/1.0
- sockwrite -n $sockname Host: $sock($sockname).addr
- sockwrite -n $sockname User-Agent: */*
- sockwrite -n $sockname Connection: Close
- sockwrite -nt $sockname $crlf
- }
- ON *:SOCKREAD:sockget_*: {
- if ($sockerr) { echo -ag ERROR: SOCKREAD -> $sock($sockname).wserr -> $sock($sockname).wsmsg | return }
- var %read
- sockread %read
- if ($sockbr) {
- ; echo -ag DATA: $left(%read,4096)
- if (*</script><div id="yfi_broker_buttons" style="min-height* iswm %read) {
- var %p = $httpstrip(%read)
- var %p = $gettok(%p,1-2,58)
- var %p = $remove(%p,BTC/USD (BTCUSD=X) -CCY ,Prev Close)
- var %n = $gettok($sock($sockname).mark,1,32)
- var %c = $gettok($sock($sockname).mark,2,32)
- if ($me !ison %c) { goto end }
- if (%n !ison %c) { goto end }
- .msg %c [ $+ %n $+ ]: BitCoin rates are: %p
- :end
- sockclose $sockname
- return
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement