Sha256: 059e44a0d862d88abc51e79f98b3c5b0f16a11706d7d0471946acc60967915e4

Contents?: true

Size: 567 Bytes

Versions: 1

Compression:

Stored size: 567 Bytes

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)

require 'nowtv'

CONFIGURE_PATH = ENV["HOME"] + '/.nowtv'

region_code =
  File.exists?(CONFIGURE_PATH) ? open(CONFIGURE_PATH).read.lines[0].strip : 'tokyo'

if ARGV.length > 1
  $stderr.puts 'Too many arguments.'
elsif ARGV.length == 1
  region_code = ARGV[0]
end

client = Nowtv::Client.new
programs = client.get_program_list(region_code)

programs.each do |program|
  puts "#{program[:station]}: #{program[:title]} [#{program[:start_time]} -> #{program[:end_time]}]"
end if programs

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nowtv-0.0.2 bin/nowtv