Class: Shoutcast::Fetcher

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/shoutcast_api.rb

Overview

Talks to shoutcast.com.

Class Method Summary collapse

Class Method Details

.genresObject

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 station name

  • :br - Match bitrate

  • :mt - Match media_type

See Stationlist or Station



59
60
61
62
63
# File 'lib/shoutcast_api.rb', line 59

def self.search(options={})
  fetch(options) do |xml|
    Stationlist.from_xml xml
  end
end