bootleg 0.0.5 → 0.0.6
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.
- data/README.md +10 -8
- data/lib/bootleg/version.rb +1 -1
- data/lib/extractor.rb +2 -1
- data/lib/generators/bootleg/templates/movie_migration.rb +0 -1
- data/lib/generators/bootleg/templates/showtime_migration.rb +1 -0
- data/lib/generators/bootleg/templates/showtime_model.rb +1 -1
- data/lib/manager.rb +7 -1
- data/lib/modules/theater.rb +2 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -28,33 +28,35 @@ Load content for a certain zipcode:
|
|
28
28
|
|
29
29
|
Example:
|
30
30
|
|
31
|
-
Bootleg.load('21102')
|
31
|
+
$ Bootleg.load('21102')
|
32
32
|
|
33
33
|
This will load all the movies for a 25 mile radius(including their showtimes
|
34
34
|
and the theaters where they play).
|
35
35
|
|
36
36
|
Examples:
|
37
37
|
|
38
|
-
movie = BootlegMovie.where(name: 'Example').first
|
38
|
+
$ movie = BootlegMovie.where(name: 'Example').first
|
39
39
|
|
40
40
|
Get all the theaters where the movie is played:
|
41
41
|
|
42
|
-
theaters = movie.theaters
|
42
|
+
$ theaters = movie.theaters
|
43
43
|
|
44
44
|
Get all the showtimes:
|
45
45
|
|
46
|
-
showtimes = movie.showtimes
|
46
|
+
$ showtimes = movie.showtimes
|
47
47
|
|
48
48
|
Get the theater of the showtimes:
|
49
49
|
|
50
|
-
theater = showtimes.first.theater
|
50
|
+
$ theater = showtimes.first.theater
|
51
51
|
|
52
|
+
## Other Details
|
52
53
|
|
53
54
|
The content is stored in 3 Active Record models BootlegMovie,
|
54
55
|
BootlegTheater and BootlegShowtime. After you load a zipcode just start
|
55
56
|
a rails console and take a look at the models to see what information is
|
56
57
|
stored inside.
|
57
58
|
|
59
|
+
The zipcode is stored under BootlegShowtime.:w
|
58
60
|
|
59
61
|
## Contributing
|
60
62
|
|
@@ -64,6 +66,6 @@ stored inside.
|
|
64
66
|
4. Push to the branch (`git push origin my-new-feature`)
|
65
67
|
5. Create new Pull Request
|
66
68
|
|
67
|
-
|
68
|
-
|
69
|
-
|
69
|
+
It is relatively easy to pull other information from moviefone.com. If you
|
70
|
+
need an extra feature and you would like to contribute feel free to shoot
|
71
|
+
me an email at marius@mlpinit.com beforehand.
|
data/lib/bootleg/version.rb
CHANGED
data/lib/extractor.rb
CHANGED
data/lib/manager.rb
CHANGED
@@ -2,10 +2,16 @@ require_relative 'finder'
|
|
2
2
|
require_relative 'extractor'
|
3
3
|
|
4
4
|
class Manager
|
5
|
+
|
6
|
+
class << self
|
7
|
+
attr_accessor :zipcode
|
8
|
+
end
|
9
|
+
|
5
10
|
def initialize(zipcode)
|
6
11
|
@zipcode = zipcode
|
7
12
|
@pages ||= find_pages
|
8
13
|
@all_theaters = []
|
14
|
+
Manager.zipcode = zipcode
|
9
15
|
end
|
10
16
|
|
11
17
|
def find_pages
|
@@ -14,7 +20,7 @@ class Manager
|
|
14
20
|
|
15
21
|
def extract_theaters
|
16
22
|
@pages.each do |page|
|
17
|
-
@all_theaters << Extractor.new(page).page_theaters
|
23
|
+
@all_theaters << Extractor.new(page, @zipcode).page_theaters
|
18
24
|
end
|
19
25
|
@all_theaters.flatten
|
20
26
|
end
|
data/lib/modules/theater.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootleg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|