Module: Rubio::RadioBrowser
- Defined in:
- lib/rubio/radio_browser.rb
Overview
Class Method Summary collapse
Class Method Details
.base_url ⇒ Object
11 12 13 |
# File 'lib/rubio/radio_browser.rb', line 11 def base_url 'http://all.api.radio-browser.info/json/' end |
.topvote(n = 100) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubio/radio_browser.rb', line 15 def topvote(n = 100) content = URI.parse(base_url + "stations/topvote/#{n}") table = {} # uuid => index result = [] JSON[content.read].each_with_index do |s, i| table[s['stationuuid']] = i result << Station.new(s['stationuuid'], s['name'], s['language'], s['url_resolved']) end [result, table] end |