Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:!mlb:#: {
- var %v = scores_ $+ $ctime $+ $ticks
- var %u = https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fwww.mlb.com%2Ffeeds%2Fnews%2Frss.xml&api_key=b82nh88k5uvwtpjrg9opvhiiyecuz4l0wp0szmec
- JSONOpen -ud %v %u
- if ($JSONError) { msg $chan ( $+ $nick $+ ): Error, There was an connection error! - Error Details: $v1 | return }
- var %t = $calc($json(%v,items).length -1)
- if (!%t) { msg $chan ( $+ $nick $+ ): No results founded. | return }
- var %i = 0
- while (%i <= %t) {
- var %title = $json(%v,items,%i,title).value
- var %link = $json(%v,items,%i,link).value
- if (!%link) { var %link = $json(%v,items,%i,guid).value }
- if (!%title) && (!%link) { goto next }
- msg $chan Title: $iif(%title,$v1,Not available) - Link: $iif(%link,$v1,Not available)
- :next
- inc %i
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement