Skip to content

Instantly share code, notes, and snippets.

@confact
Last active September 23, 2017 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save confact/40e7ce333cee6ae6bec7d74b6bc42fd8 to your computer and use it in GitHub Desktop.
Save confact/40e7ce333cee6ae6bec7d74b6bc42fd8 to your computer and use it in GitHub Desktop.
get url for *cast server
def song_page
url_string = "#{@url.scheme}://#{@url.host}:#{@url.port}"
if %(SHOUTcast).include? @server
if Gem::Version.new(@version) > Gem::Version.new('2.0')
return "#{url_string}/stats?sid=1"
else
return "#{url_string}/7.html"
end
elsif %(Icecast).include? @server
return false if @url.to_s.include? 'dirble'
return "#{url_string}#{@url.path}.xspf"
else
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment