nyc-theater-discounts 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nyc-theater-discounts +2 -1
- data/lib/nyc_theater_discounts/cli.rb +2 -1
- data/lib/nyc_theater_discounts/scraper.rb +2 -2
- data/lib/nyc_theater_discounts/show.rb +7 -15
- data/lib/nyc_theater_discounts/vendor.rb +4 -14
- data/lib/nyc_theater_discounts/version.rb +1 -1
- data/nyc-theater-discounts-0.1.2.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a46497a1269b4e2a5bbf155cfec5662a378d2ac4
|
4
|
+
data.tar.gz: 5a3acb6780a3a28ffaf5c45e48f82d022172da86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6b6ea36f673fb6d206da60abd668487c79b3d23d3067a736fddef0948c2f79f9fb8325420226bc3a2c2ec92ea8ad65abbf964a510ed9b245812f05158b94d38
|
7
|
+
data.tar.gz: e2ff6d272e18ca2d14c255f185fd936503e65936ec078b646ad24a65a2b8437a440619eaab205e22044857fd384de7bb471f229abf787e19d25dee4a425d8169
|
data/bin/nyc-theater-discounts
CHANGED
@@ -4,10 +4,11 @@ require 'pry'
|
|
4
4
|
class NYCTheaterDiscounts::CLI
|
5
5
|
|
6
6
|
def call
|
7
|
+
puts "*** Loading Deals ***"
|
7
8
|
NYCTheaterDiscounts::Scraper.load_TodayTix
|
8
9
|
NYCTheaterDiscounts::Scraper.load_Theatermania
|
9
10
|
NYCTheaterDiscounts::Scraper.load_BroadwayBox
|
10
|
-
puts "Hello theater nerd! Here are the discount sources available:"
|
11
|
+
puts "Hello theater nerd! Here are the discount sources available today:"
|
11
12
|
list_vendors
|
12
13
|
puts "To see a list of deals for each vendor type the number of the vendor. To search by show type 'by show'. To quit, type 'exit'."
|
13
14
|
starting_menu
|
@@ -13,7 +13,7 @@ class NYCTheaterDiscounts::Scraper
|
|
13
13
|
deals_page.css("div.shows_hero_container a.heroTile.grid").each do |show|
|
14
14
|
|
15
15
|
title = show.css('header span.title').text
|
16
|
-
link = "http://www.todaytix.com
|
16
|
+
link = "http://www.todaytix.com" + show['href']
|
17
17
|
price = show['data-min-price']
|
18
18
|
price = "$" + price.to_s
|
19
19
|
|
@@ -37,7 +37,7 @@ class NYCTheaterDiscounts::Scraper
|
|
37
37
|
deals_page.css("div#listings_right div#result div.list div.show.logo").each do |show|
|
38
38
|
|
39
39
|
title = show.css('a.show-title span.show-name').text
|
40
|
-
link = "http://www.theatermania.com
|
40
|
+
link = "http://www.theatermania.com" + show.css('a.show-title')[0]['href']
|
41
41
|
price = show.css("div strong").text
|
42
42
|
|
43
43
|
newshow = NYCTheaterDiscounts::Show.new(title, price, link)
|
@@ -7,29 +7,21 @@ class NYCTheaterDiscounts::Show
|
|
7
7
|
|
8
8
|
@@all = []
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@name =
|
12
|
-
@price =
|
13
|
-
@deal_url =
|
10
|
+
def initialize(show_name, show_price, url)
|
11
|
+
@name = show_name
|
12
|
+
@price = show_price
|
13
|
+
@deal_url = url
|
14
14
|
@vendors = []
|
15
15
|
@@all << self
|
16
16
|
end
|
17
|
+
|
17
18
|
|
18
19
|
def self.all
|
19
|
-
|
20
|
-
@@all
|
21
|
-
else
|
22
|
-
@@all.uniq!
|
23
|
-
end
|
20
|
+
@@all
|
24
21
|
end
|
25
22
|
|
26
23
|
def vendors
|
27
|
-
|
28
|
-
@vendors
|
29
|
-
else
|
30
|
-
@vendors.uniq!
|
31
|
-
end
|
32
|
-
return @vendors
|
24
|
+
@vendors
|
33
25
|
end
|
34
26
|
|
35
27
|
def find_by_name(nameval)
|
@@ -7,28 +7,18 @@ class NYCTheaterDiscounts::Vendor
|
|
7
7
|
|
8
8
|
@@all = []
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@name =
|
10
|
+
def initialize( vendor_name, path)
|
11
|
+
@name = vendor_name
|
12
12
|
@url = path
|
13
13
|
@shows = []
|
14
14
|
@@all << self
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.all
|
18
|
-
|
19
|
-
@@all
|
20
|
-
else
|
21
|
-
@@all.uniq!
|
22
|
-
end
|
18
|
+
@@all
|
23
19
|
end
|
24
20
|
|
25
21
|
def shows
|
26
|
-
|
27
|
-
@shows
|
28
|
-
else
|
29
|
-
@shows.uniq!
|
30
|
-
end
|
31
|
-
return @shows
|
22
|
+
@shows
|
32
23
|
end
|
33
|
-
|
34
24
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyc-theater-discounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaileigh McCrea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/nyc_theater_discounts/version.rb
|
108
108
|
- nyc-theater-discounts-0.1.0.gem
|
109
109
|
- nyc-theater-discounts-0.1.1.gem
|
110
|
+
- nyc-theater-discounts-0.1.2.gem
|
110
111
|
- nyc-theater-discounts.gemspec
|
111
112
|
homepage: https://github.com/kaileighrose/nyc-theater-discounts-cli-gem
|
112
113
|
licenses:
|