Class: WhatsOn::Show
- Inherits:
-
Object
- Object
- WhatsOn::Show
- Defined in:
- lib/whats_on/show.rb
Instance Attribute Summary collapse
-
#airing ⇒ Object
Returns the value of attribute airing.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Attribute Details
#airing ⇒ Object
Returns the value of attribute airing.
2 3 4 |
# File 'lib/whats_on/show.rb', line 2 def airing @airing end |
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/whats_on/show.rb', line 2 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/whats_on/show.rb', line 2 def name @name end |
Class Method Details
.all ⇒ Object
5 6 7 |
# File 'lib/whats_on/show.rb', line 5 def self.all self.scrape_shows end |
.scrape_shows ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/whats_on/show.rb', line 9 def self.scrape_shows shows_array= [] doc = Nokogiri::HTML(open("http://www.tvguide.com/trending-tonight/")) doc.css(".listings-program").each do |item| production = { :name => item.at_css(".listings-program-link").text, :airing => item.at_css(".listings-program-airing-info").text, :description => item.at_css(".listings-program-description").text } shows_array<<production end shows_array end |