In-theater 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: b654b1ae688e2490bde5d0b9469e821b7cbc448c
4
- data.tar.gz: 33d81b6a23b486a6fec52ad97cbe7970e6a683b7
3
+ metadata.gz: bb1af06c3bc8669ee6449b26ef07a6aeb3980962
4
+ data.tar.gz: e9ea863d9e39da993ec5ae520481dd6922ea1b3c
5
5
  SHA512:
6
- metadata.gz: e10087f0636c6e521988defc54f70c0dd0c977883e43e1cc30e94c8736debe8981f9a923c913edf7d24a396880f7eabc8710c0cc9cd80288480fe378eaf2e873
7
- data.tar.gz: 62f8c359efceba173461e85c4e5a6b1ba5d3edaa1e22f867648a67368f493ee7afb08ea8d1c6d6f19ac340eceb0a8c8182ffef9b08c64a83c8c71639952e2623
6
+ metadata.gz: d589bcc367103b0bb4e7330bcc46e362dfb07448a8dfb53c3a4fdae4e992bb60dd9f0fb4050d7124425c5484d197ec7992f577005fdccf048c7326ab0d324cef
7
+ data.tar.gz: d36fad11b671c7d20782af5198d942f58c592e5bfea5be8465cd88be44088bd7b0efe03a718e1bc401e18f211ddf5014599072c26d0e7644592b12d3790f64e3
@@ -8,7 +8,6 @@ class In_theater::Movie
8
8
 
9
9
  def self.all
10
10
  @@all ||= scrape_now_playing
11
-
12
11
  end
13
12
 
14
13
  def self.movies
@@ -23,8 +22,7 @@ class In_theater::Movie
23
22
 
24
23
  arr ||= array.collect.with_index(1) do |m, i|
25
24
  m, i = m, i if ( m.name.downcase.strip == name.downcase.strip ||
26
- m.name.split("(").first.strip.downcase == name.downcase.strip
27
- )
25
+ m.name.split("(").first.strip.downcase == name.downcase.strip)
28
26
  end
29
27
 
30
28
  arr.detect {|n| n if n != nil}
@@ -35,16 +33,16 @@ class In_theater::Movie
35
33
 
36
34
  doc ||= Nokogiri::HTML(open(obj.url.gsub("movieoverview", "plotsummary")))
37
35
 
38
- if doc.search("p[class='subpage-descriptive-content']").text == ""
39
- doc = Nokogiri::HTML(open(obj.url))
40
- puts "-------------- #{obj.name} summary --------------"
41
- puts doc.search("span[id='SynopsisTextLabel']").text
36
+ if doc.search("p[class='subpage-descriptive-content']").text == ""
37
+ doc = Nokogiri::HTML(open(obj.url))
38
+ puts "-------------- #{obj.name} summary --------------"
39
+ puts doc.search("span[id='SynopsisTextLabel']").text
42
40
 
43
- else
44
- puts "-------------- #{obj.name} summary --------------"
45
- puts doc.search("p[class='subpage-descriptive-content']").text
41
+ else
42
+ puts "-------------- #{obj.name} summary --------------"
43
+ puts doc.search("p[class='subpage-descriptive-content']").text
46
44
 
47
- end
45
+ end
48
46
 
49
47
  end
50
48
 
@@ -53,11 +51,11 @@ class In_theater::Movie
53
51
  puts "Enter zip code:"
54
52
  input = gets.strip
55
53
 
56
- doc = Nokogiri::HTML(open("http://www.fandango.com/#{input.to_i}_movietimes/"))
57
-
58
- names = doc.search("a[class='light showtimes-theater-title']")
54
+ @doc = Nokogiri::HTML(open("http://www.fandango.com/#{input.to_i}_movietimes/"))
55
+ @theaters = @doc.xpath("//a[@class='light showtimes-theater-title']")
56
+ #binding.pry
59
57
 
60
- names.to_a.collect { |name| new(name.children.text.strip, name.attributes.to_a[1][1].value ) }
58
+ @theaters.collect { |theater| new(theater.children.text.strip, theater.attributes.to_a[1][1].value) }
61
59
 
62
60
  end
63
61
 
@@ -65,11 +63,17 @@ class In_theater::Movie
65
63
 
66
64
 
67
65
  def self.custom_method(arg)
66
+ @doc = Nokogiri::HTML(open(arg))
67
+
68
+
69
+ @movies = @doc.xpath("//a[@class='dark showtimes-movie-title']")
70
+ #binding.pry
68
71
 
69
- doc ||= Nokogiri::HTML(open(arg))
70
- doc.search("a[class='dark showtimes-movie-title']").to_a.collect.with_index(1) do |name, i|
71
- new(name.children.text.strip, name.attributes.to_a[1][1].value )
72
- end
72
+ #doc.search("a[class='dark showtimes-movie-title']").to_a.
73
+ @movies.collect.with_index(1) { |name|
74
+ new(name.children.text.strip, name.attributes.to_a[1][1].value )
75
+ }
76
+ #end
73
77
 
74
78
  end
75
79
 
@@ -1,4 +1,4 @@
1
1
  module In_theater
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
 
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: In-theater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kade042
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-04 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri