new_york_films 0.1.4 → 0.1.5
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 +4 -4
- data/lib/new_york_films/film_finder.rb +11 -17
- data/lib/new_york_films/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a15e64bc06dff2f29440da046538a26764647725
|
|
4
|
+
data.tar.gz: 5d75ce7775a7f2827c95f75c9230cf6f5fd5499b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7db17d589270883f43786d46cba77b41a8acf3034eef063719d2f29971d161e143b06e0cf2f93a6e3e89f42e2cfe9ccff3b1ac355127629372dc4327b760de23
|
|
7
|
+
data.tar.gz: 516e815375fbfd8a1480749f930bef4754df0d2c58e597c17792580ed9c0410489e5ad2475067adac7c0d24b51a302995d7719634a67e96d75fb4732e8a8e8e3
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
require 'nokogiri'
|
|
2
2
|
require 'open-uri'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class NewYorkFilms::Screening
|
|
6
|
-
attr_accessor :theater, :title, :times, :director, :year, :length, :website, :location
|
|
7
|
-
def initialize(attributes = {})
|
|
8
|
-
@theater = attributes[:theater]
|
|
9
|
-
@title = attributes[:title]
|
|
10
|
-
@director = attributes[:director]
|
|
11
|
-
@times = attributes[:times]
|
|
12
|
-
@year = attributes[:year]
|
|
13
|
-
@length = attributes[:length]
|
|
14
|
-
@website = attributes[:website]
|
|
15
|
-
@location = attributes[:location]
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
3
|
+
require_relative "./screening.rb"
|
|
19
4
|
|
|
20
5
|
class NewYorkFilms::FilmFinder
|
|
21
6
|
|
|
@@ -30,12 +15,19 @@ def self.all
|
|
|
30
15
|
@@all_films
|
|
31
16
|
end
|
|
32
17
|
|
|
18
|
+
# def check_if_provided(css)
|
|
19
|
+
# return css.text unless css == nil then "not provided"
|
|
20
|
+
# end
|
|
21
|
+
|
|
33
22
|
def self.scraper
|
|
34
23
|
doc = Nokogiri::HTML(open("http://www.screenslate.com/"))
|
|
35
24
|
|
|
36
25
|
doc.search("ul li.screenings__venue___2EEUR li.screenings__screening___2wxaa").map do |film|
|
|
37
26
|
@@all_films << screening = NewYorkFilms::Screening.new
|
|
38
27
|
|
|
28
|
+
# screening.theater = check_if_provided(film.parent.parent.css("h3"))
|
|
29
|
+
# screening.title = check_if_provided()
|
|
30
|
+
|
|
39
31
|
if film.parent.parent.css("h3") != nil
|
|
40
32
|
screening.theater = film.parent.parent.css("h3").text
|
|
41
33
|
else
|
|
@@ -84,7 +76,9 @@ def self.scraper
|
|
|
84
76
|
|
|
85
77
|
if venue.css("div.venue__info___2bLnH p") != nil
|
|
86
78
|
screening.location = venue.css("div.venue__info___2bLnH p").first.text.gsub("Location ", "") if venue.css("div.venue__info___2bLnH p").first.text.include?(", NY")
|
|
87
|
-
|
|
79
|
+
if venue.css("div.venue__info___2bLnH p")[1]
|
|
80
|
+
screening.location = venue.css("div.venue__info___2bLnH p")[1].text.gsub("Location ", "") if venue.css("div.venue__info___2bLnH p")[1].text.include?(", NY")
|
|
81
|
+
end
|
|
88
82
|
else
|
|
89
83
|
screening.location = "please see theater's website."
|
|
90
84
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: new_york_films
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Norris
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-08-
|
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|