Advertisement
westor

MLB News v1.1 for dma

May 13th, 2019
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.61 KB | None | 0 0
  1. ON *:TEXT:!mlb:#: {
  2.   if ($sock(scores)) { msg $chan $nick Error! Please wait already in use. | return }
  3.   sockopen scores feeds.feedburner.com 80
  4.   sockmark scores $chan
  5. }
  6.  
  7. ON *:SOCKOPEN:scores: {
  8.   if ($sockerr) {
  9.     var %chan = $gettok($sock($sockname).mark,1,32)
  10.     if (%chan ischan) { msg %chan Socket Open Error! - Error: $sock($sockname).wsmsg }
  11.     return
  12.   }
  13.   sockwrite -nt $sockname GET /mlb/dma HTTP/1.1
  14.   sockwrite -nt $sockname Host: $sock($sockname).addr
  15.   sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
  16.   sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  17.   sockwrite -nt $sockname Connection: keep-alive
  18.   sockwrite -nt $sockname $crlf
  19. }
  20.  
  21. ON *:SOCKREAD:scores: {
  22.   if ($sockerr) {
  23.     var %chan = $gettok($sock($sockname).mark,1,32)
  24.     if (%chan ischan) { msg %chan Socket Read Error! - Error: $sock($sockname).wsmsg }
  25.     sockclose $sockname
  26.     return
  27.   }
  28.  
  29.   var %scores
  30.   sockread %scores
  31.  
  32.   tokenize 32 $remove(%scores,$chr(9))
  33.  
  34.   if ($1 == </lastBuildDate>) { set -e %scores_start 1 }
  35.  
  36.   if (%scores_start) && ($left($1-,7) == <title>) { set -e %scores_out Title: $remove($1-,<title>,</title>) }
  37.   if (%scores_start) && ($left($1-,6) == <link>) { set -e %scores_out %scores_out - Link: $remove($1-,<link>,</link>) }
  38.   if ($1 == </item>) {
  39.     var %chan = $gettok($sock($sockname).mark,1,32)
  40.     if (%scores_out) && (%chan ischan) { msg %chan %scores_out }
  41.     unset %scores_out
  42.   }
  43.  
  44.   if ($1 == </rss>) { unset %scores_start %scores_out | sockclose $sockname }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement