Skip to content

Instantly share code, notes, and snippets.

@njh
Created March 30, 2023 15:38
Show Gist options
  • Save njh/73647287e0c248814305a25163459045 to your computer and use it in GitHub Desktop.
Save njh/73647287e0c248814305a25163459045 to your computer and use it in GitHub Desktop.
RadioDNS test for Radioplayer
#!/usr/bin/env ruby
require 'radiodns'
require 'uri'
puts "Looking up FQDN for Wycombe Sound 106.6"
params = {
:freq => '10660',
:pi => 'c0a6',
:ecc => 'ce1',
:bearer => 'fm'
}
service = RadioDNS::Resolver.resolve(params)
puts "=> #{service.cname}"
puts "Lookup up server for RadioEPG"
radioepg = service.radioepg
puts "=> #{radioepg.host}:#{radioepg.port}"
puts "Calcularing URI for Service Information"
uri = URI.parse("http://#{radioepg.host}:#{radioepg.port}/radiodns/spi/3.1/SI.xml")
puts "=> #{uri}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment