#!/usr/bin/ruby require 'libhttpclient' if ARGV.empty? ARGV << 'heroes' << 'house' << 'supernatural' << '24' << 'south_park' end ARGV.each { |s| begin h = HttpClient.new('http://sharetv.org/') p = h.get("/shows/#{s}") flag = false p.parse('String').each { |s| s = s['content'] if s =~ /returns in/ print s, ' ' flag = true elsif flag puts s break end } if not flag puts p.get_text end rescue puts $! end }