what_to_watch 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc62fe0cde36b6df0b7b3eefef15af609b8750c7b07accd0c00ed62a6416ea5d
4
- data.tar.gz: 399f92b05cfa3cbf992ee15d006e63e1637bc167ff1678b6e93e90dd78ffe9f5
3
+ metadata.gz: 04541d78c0b2848f78adf9e0f8a51b4feaf489e9457ad73466463605462ea105
4
+ data.tar.gz: 97ccbe654e5feed8a32a793ce89fb375df0e40a05d1344e3a08e2cde057d4b2c
5
5
  SHA512:
6
- metadata.gz: 7a3f7a94ec6c272480d77dafc3736680289084f5e1295689b7aab8d995ef15f87f84ac8668f73438b1d36ecc245f8cce477aecfca567c645383c9801d6cf784b
7
- data.tar.gz: fce9a7874ecfcace8d9963d9c3b7f43526678b160a53b8450d081b00cb878ce3e901776b986025424a6a08a78921eca7bea7858f3ca81cdc55476b7892861f7d
6
+ metadata.gz: b7c422625a328955a7e837059d267a4ff426472cbed58cc59fdce1480ba483af8ad5394f05325d4835f854fd4264001cb3d7d1f1d7f7da8306700abb2d420053
7
+ data.tar.gz: 38fce5c81283e126a03e9aa56cef71326aa0fae4b59d3651aed0a6e450b93b4ab0a1aaa30eae2cfc2d7feaedf4ee29a48c51bac2e4f5f0be27506c48c6e74f08
data/.DS_Store CHANGED
Binary file
Binary file
@@ -10,8 +10,8 @@ class WhatToWatch::BestMovies < WhatToWatch::Show
10
10
  @@all = []
11
11
  end
12
12
 
13
- def self.rows
14
- [10, 11]
13
+ def self.section
14
+ 3
15
15
  end
16
16
 
17
17
  def self.list(hash)
@@ -10,8 +10,8 @@ class WhatToWatch::BestTV < WhatToWatch::Show
10
10
  @@all = []
11
11
  end
12
12
 
13
- def self.rows
14
- [7, 8, 9]
13
+ def self.section
14
+ 2
15
15
  end
16
16
 
17
17
  def self.list(hash)
@@ -10,8 +10,8 @@ class WhatToWatch::RecentlyAdded < WhatToWatch::Show
10
10
  @@all = []
11
11
  end
12
12
 
13
- def self.rows
14
- [1, 2, 3, 4, 5]
13
+ def self.section
14
+ 0
15
15
  end
16
16
 
17
17
  def self.list(hash)
@@ -3,15 +3,15 @@ class WhatToWatch::Scraper
3
3
 
4
4
  def self.scrape_vulture(model)
5
5
  doc = Nokogiri::HTML(open("http://vulture.com/streaming"))
6
- model.rows.each do |row|
7
- block = doc.css("div.what-to-watch.row-#{row}")
8
- block.css("ul.row li").each do |item|
6
+ block = doc.css("div[data-editable='main']")[model.section]
7
+ block.css("div.column-item").each do |row|
8
+ row.css("section").drop(1).each do |item|
9
9
  model.new(
10
- item.css("a.title").attr("title").text.strip,
11
- block.css("h4").text.strip
10
+ item.css("div[itemprop='caption']").text.split("\n")[1].strip.gsub(" ", " "),
11
+ row.css("section")[0].css("h3").text.strip.capitalize
12
12
  )
13
- end
14
- end
13
+ end
14
+ end
15
15
  end
16
16
 
17
17
  #Scrape Search Page on imdb.com to determine the Item Page URL
@@ -20,14 +20,10 @@ attr_accessor :title, :streaming_service, :url, :description, :genre_year, :cast
20
20
  def self.services(hash)
21
21
  services = hash.collect do |service, value|
22
22
  if value == "y"
23
- service.to_s.split('_').map(&:capitalize).join(' ')
23
+ service.to_s.split('_').join(' ').capitalize
24
24
  end
25
25
  end
26
26
  services.compact!
27
- if services.include?("Hbo Now")
28
- services << "HBO Now"
29
- end
30
- services
31
27
  end
32
28
 
33
29
 
@@ -55,7 +51,7 @@ attr_accessor :title, :streaming_service, :url, :description, :genre_year, :cast
55
51
  puts "===================================="
56
52
  puts "#{object.genre_year}"
57
53
  puts ""
58
- puts "*** Available on #{object.streaming_service} ***"
54
+ puts "*** Available on #{object.streaming_service.upcase} ***"
59
55
  puts ""
60
56
  object.cast.each{|role, people| puts "#{role} #{people}"}
61
57
  puts ""
@@ -1,3 +1,3 @@
1
1
  module WhatToWatch
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: what_to_watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'George Pianka'"