Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:!mlb:#: {
- if ($sock(scores)) { msg $chan $nick Error! Please wait already in use. | return }
- sockopen scores feeds.feedburner.com 80
- sockmark scores $chan
- }
- ON *:SOCKOPEN:scores: {
- if ($sockerr) {
- var %chan = $gettok($sock($sockname).mark,1,32)
- if (%chan ischan) { msg %chan Socket Open Error! - Error: $sock($sockname).wsmsg }
- return
- }
- sockwrite -nt $sockname GET /mlb/dma HTTP/1.1
- sockwrite -nt $sockname Host: $sock($sockname).addr
- sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
- sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- sockwrite -nt $sockname Connection: keep-alive
- sockwrite -nt $sockname $crlf
- }
- ON *:SOCKREAD:scores: {
- if ($sockerr) {
- var %chan = $gettok($sock($sockname).mark,1,32)
- if (%chan ischan) { msg %chan Socket Read Error! - Error: $sock($sockname).wsmsg }
- sockclose $sockname
- return
- }
- var %scores
- sockread %scores
- tokenize 32 $remove(%scores,$chr(9))
- if ($1 == </lastBuildDate>) { set -e %scores_start 1 }
- if (%scores_start) && ($left($1-,7) == <title>) { set -e %scores_out Title: $remove($1-,<title>,</title>) }
- if (%scores_start) && ($left($1-,6) == <link>) { set -e %scores_out %scores_out - Link: $remove($1-,<link>,</link>) }
- if ($1 == </item>) {
- var %chan = $gettok($sock($sockname).mark,1,32)
- if (%scores_out) && (%chan ischan) { msg %chan %scores_out }
- unset %scores_out
- }
- if ($1 == </rss>) { unset %scores_start %scores_out | sockclose $sockname }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement