Advertisement
westor

MLB News v2.0 for dma

May 19th, 2019
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.83 KB | None | 0 0
  1. ON *:TEXT:!mlb:#: {
  2.  
  3.   var %v = scores_ $+ $ctime $+ $ticks
  4.   var %u = https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fwww.mlb.com%2Ffeeds%2Fnews%2Frss.xml&api_key=b82nh88k5uvwtpjrg9opvhiiyecuz4l0wp0szmec
  5.  
  6.   JSONOpen -ud %v %u
  7.   if ($JSONError) { msg $chan ( $+ $nick $+ ): Error, There was an connection error! - Error Details: $v1 | return }
  8.  
  9.   var %t = $calc($json(%v,items).length -1)
  10.   if (!%t) { msg $chan ( $+ $nick $+ ): No results founded. | return }
  11.  
  12.   var %i = 0
  13.   while (%i <= %t) {
  14.  
  15.     var %title = $json(%v,items,%i,title).value
  16.     var %link = $json(%v,items,%i,link).value
  17.     if (!%link) { var %link = $json(%v,items,%i,guid).value }
  18.  
  19.     if (!%title) && (!%link) { goto next }
  20.  
  21.     msg $chan Title: $iif(%title,$v1,Not available) - Link: $iif(%link,$v1,Not available)
  22.  
  23.     :next
  24.     inc %i
  25.   }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement