44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/comic_walker/cli.rb', line 44
def contents
jar = HTTP::CookieJar.new
load_cookies(jar)
client = V1::Client.new(jar, load_uuid)
json = client.contents(per_page: options[:per_page], page: options[:page])
save_cookies(jar)
json['contents'].sort_by { |content| Time.parse(content['updated_at']) }.reverse_each do |content|
next unless content.has_key?('sub_contents')
puts "#{content['name']} http://comic-walker.com/contents/detail/#{content['content_id']}"
puts " Updated: #{format_time(content['updated_at'])}"
puts " Deliver: #{format_time(content['deliver_start_date'])} - #{format_time(content['deliver_stop_date'])}"
tags = content['tags']
puts " Episodes:"
tags['visible_episodes'].each_key do |episode|
_, desc, cid = *episode.split('|')
puts " #{desc} http://comic-walker.com/viewer/?cid=#{cid}"
end
if next_issue = tags['publication_date_of_next_issue']
next_issue = format_time(next_issue.keys.first)
else
next_issue = 'UNKNOWN'
end
puts " Next: #{next_issue}"
end
end
|