Class: Shoutcast::Fetcher
- Inherits:
-
Object
- Object
- Shoutcast::Fetcher
- Includes:
- HTTParty
- Defined in:
- lib/shoutcast_api.rb
Overview
Talks to shoutcast.com.
Class Method Summary collapse
-
.genres ⇒ Object
Fetch all genres defined at shoutcast.com.
-
.search(options = {}) ⇒ Object
Search for available stations.
Class Method Details
.genres ⇒ Object
Fetch all genres defined at shoutcast.com.
Usage
Fetcher.genres.each do |genre|
p genre.name
end
See Genrelist or Genre
40 41 42 43 44 |
# File 'lib/shoutcast_api.rb', line 40 def self.genres fetch do |xml| Genrelist.from_xml xml end end |
.search(options = {}) ⇒ Object
Search for available stations.
Usage
Fetcher.search(:name => "California", :br => 128, :mt => "audio/mpeg")
Search options
-
:name
- Match stationname
-
:br
- Matchbitrate
-
:mt
- Matchmedia_type
See Stationlist or Station
59 60 61 62 63 |
# File 'lib/shoutcast_api.rb', line 59 def self.search(={}) fetch() do |xml| Stationlist.from_xml xml end end |