Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bind pub - "!titre" radio:titre
- set radio(#GlobalIRC) "de7d8db6-8ee6-451c-b61d-2d4ac8427864"
- set radio(#ItalianRadioPS) "de7d8db6-8ee6-451c-b61d-2d4ac8427864"
- package require http
- proc radio:titre { nick uhost handle chan args } {
- if { [lsearch [string tolower $chan] [array names ::radio]] == -1} { return 0 }
- set url "http://api.radionomy.com/currentsong.cfm?"
- append url "radiouid=" $::radio([string tolower $chan]) "&apikey=" $::radio([string tolower $chan]) "&type=xml"
- putlog "url: $url"
- set page [::http::geturl $url -timeout 3000]
- set html [::http::data $page]
- regexp -all -- {<title>(.+)?</title>} $html null title
- regexp -all -- {<radioname>(.+)?</radioname} $html null radio
- regexp -all -- {<artists>(.+)?</artists>} $html null artist
- putserv "PRIVMSG $chan :En cours sur \002 .::. [htmlentities_decode $radio] .::. \002: \002[htmlentities_decode $title]\002 par \002[htmlentities_decode $artist]\002"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement