Class: RTV::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/rtv.rb

Class Method Summary collapse

Class Method Details

.getTVString(args) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rtv.rb', line 23

def self.getTVString args
  config = {:senderfilter=>["pro7", "arte", "3sat", "rtl2", "sat1", "vox", "rtl", "k1"],
    :senderressource=>"sendergruppeId:1,3",
    :charset=>"UTF-8",
    :senderlimit=>15,
    :eine_pro_sender=>false,
    :redundanz=>false}

  newconfig = begin
                configfile = File.join(Gem.user_home, '.rtv')
                YAML.load(File.read(configfile))
              rescue
                {}
              end

  config.update newconfig

  swtch = RTV::Switcher.new
  swtch.config = config

  rtv = RTV::Fetcher.new
  rtv.config = swtch.config
  rtv.options = swtch.uri_options(args)

  program = rtv.fetch

  prtr = RTV::Presenter.new rtv.config[:charset]
  prtr.config = swtch.config
  return prtr.to_s(program)

end