book_club_picks 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/bin/book_club_picks +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/book_club_picks.gemspec +34 -0
- data/lib/book_club_picks/books.rb +135 -0
- data/lib/book_club_picks/cli.rb +118 -0
- data/lib/book_club_picks/scraper.rb +22 -0
- data/lib/book_club_picks/version.rb +3 -0
- data/lib/book_club_picks.rb +9 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb4a91e7daec460dfc4ca7eeaf1f894e770fa1ef
|
4
|
+
data.tar.gz: 66c227ebc9d915f1841ef830878c77e6559f5d59
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fde772755fee67aacda0fa790df8f37ac8f184015c9da16d422bb8ddf4dcbc8d9681a38c15f8d074b941957b46bbb5b43a8993881f0ec98717d2ced0960091d9
|
7
|
+
data.tar.gz: 1afc5998af5367a7449005f12411bad5ff3b50ec492dd44f8333e56d71e5a2501baf858f7c26c408c138694ceec076460240c20c5cf0782f7f2eb531cd0e0972
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at jenanton01@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 sensei100
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# BookClubPicks
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/book_club_picks`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'book_club_picks'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install book_club_picks
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/book_club_picks. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/book_club_picks
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "book_club_picks"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'book_club_picks/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "book_club_picks"
|
8
|
+
spec.version = BookClubPicks::VERSION
|
9
|
+
spec.authors = ["Jennifer Anton"]
|
10
|
+
spec.email = ["jenanton01@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{A command line interface that gives the user information about popular books.}
|
13
|
+
spec.homepage = "https://github.com/sensei100/book_club_picks"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
if spec.respond_to?(:metadata)
|
19
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
20
|
+
else
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_development_dependency "pry"
|
32
|
+
|
33
|
+
spec.add_dependency "nokogiri"
|
34
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
class BookClubPicks::Book
|
2
|
+
|
3
|
+
attr_accessor :name, :author, :published, :clubs, :summary
|
4
|
+
|
5
|
+
def initialize(name = nil, author = nil, published = nil, clubs = nil, summary = nil)
|
6
|
+
@name = name
|
7
|
+
@author = author
|
8
|
+
@published = published
|
9
|
+
@clubs = clubs
|
10
|
+
@summary = summary
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.scrape_details_1
|
14
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
15
|
+
|
16
|
+
individual_details = self.new
|
17
|
+
individual_details.name = doc.search("h2")[0].text.strip
|
18
|
+
individual_details.published = doc.search("div.midd .omatter")[0].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
19
|
+
individual_details.clubs = doc.css(".recomnd")[0].text.strip
|
20
|
+
individual_details.summary = doc.css(".midd .statement")[0].text.strip.gsub('â', "\'").gsub('Â', " ")
|
21
|
+
|
22
|
+
individual_details
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.scrape_details_2
|
26
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
27
|
+
|
28
|
+
individual_details = self.new
|
29
|
+
individual_details.name = doc.search("h2")[1].text.strip
|
30
|
+
individual_details.published = doc.search("div.midd .omatter")[1].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
31
|
+
individual_details.clubs = doc.css(".recomnd")[1].text.strip
|
32
|
+
individual_details.summary = doc.css(".midd .statement")[1].text.strip.gsub('â', "\'").gsub('Â', " ")
|
33
|
+
|
34
|
+
individual_details
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.scrape_details_3
|
38
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
39
|
+
|
40
|
+
individual_details = self.new
|
41
|
+
individual_details.name = doc.search("h2")[2].text.strip
|
42
|
+
individual_details.published = doc.search("div.midd .omatter")[2].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
43
|
+
individual_details.clubs = doc.css(".recomnd")[2].text.strip
|
44
|
+
individual_details.summary = doc.css(".midd .statement")[2].text.strip.gsub('â', "\'").gsub('Â', " ")
|
45
|
+
|
46
|
+
individual_details
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.scrape_details_4
|
50
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
51
|
+
|
52
|
+
individual_details = self.new
|
53
|
+
individual_details.name = doc.search("h2")[3].text.strip
|
54
|
+
individual_details.published = doc.search("div.midd .omatter")[3].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
55
|
+
individual_details.clubs = doc.css(".recomnd")[3].text.strip
|
56
|
+
individual_details.summary = doc.css(".midd .statement")[3].text.strip.gsub('â', "\'").gsub('Â', " ")
|
57
|
+
|
58
|
+
individual_details
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.scrape_details_5
|
62
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
63
|
+
|
64
|
+
individual_details = self.new
|
65
|
+
individual_details.name = doc.search("h2")[4].text.strip
|
66
|
+
individual_details.published = doc.search("div.midd .omatter")[4].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
67
|
+
individual_details.clubs = doc.css(".recomnd")[4].text.strip
|
68
|
+
individual_details.summary = doc.css(".midd .statement")[4].text.strip.gsub('â', "\'").gsub('Â', " ")
|
69
|
+
|
70
|
+
individual_details
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.scrape_details_6
|
74
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
75
|
+
|
76
|
+
individual_details = self.new
|
77
|
+
individual_details.name = doc.search("h2")[5].text.strip
|
78
|
+
individual_details.published = doc.search("div.midd .omatter")[5].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
79
|
+
individual_details.clubs = doc.css(".recomnd")[5].text.strip
|
80
|
+
individual_details.summary = doc.css(".midd .statement")[5].text.strip.gsub('â', "\'").gsub('Â', " ")
|
81
|
+
|
82
|
+
individual_details
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.scrape_details_7
|
86
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
87
|
+
|
88
|
+
individual_details = self.new
|
89
|
+
individual_details.name = doc.search("h2")[6].text.strip
|
90
|
+
individual_details.published = doc.search("div.midd .omatter")[6].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
91
|
+
individual_details.clubs = doc.css(".recomnd")[6].text.strip
|
92
|
+
individual_details.summary = doc.css(".midd .statement")[6].text.strip.gsub('â', "\'").gsub('Â', " ")
|
93
|
+
|
94
|
+
individual_details
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.scrape_details_8
|
98
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
99
|
+
|
100
|
+
individual_details = self.new
|
101
|
+
individual_details.name = doc.search("h2")[7].text.strip
|
102
|
+
individual_details.published = doc.search("div.midd .omatter")[7].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
103
|
+
individual_details.clubs = doc.css(".recomnd")[7].text.strip
|
104
|
+
individual_details.summary = doc.css(".midd .statement")[7].text.strip.gsub('â', "\'").gsub('Â', " ")
|
105
|
+
|
106
|
+
individual_details
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.scrape_details_9
|
110
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
111
|
+
|
112
|
+
individual_details = self.new
|
113
|
+
individual_details.name = doc.search("h2")[8].text.strip
|
114
|
+
individual_details.published = doc.search("div.midd .omatter")[8].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
115
|
+
individual_details.clubs = doc.css(".recomnd")[8].text.strip
|
116
|
+
individual_details.summary = doc.css(".midd .statement")[8].text.strip.gsub('â', "\'").gsub('Â', " ")
|
117
|
+
|
118
|
+
individual_details
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.scrape_details_ten
|
122
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
123
|
+
|
124
|
+
individual_details = self.new
|
125
|
+
individual_details.name = doc.search("h2")[9].text.strip
|
126
|
+
individual_details.published = doc.search("div.midd .omatter")[9].text.strip.split('Paperback').first.split('Hardcover').first.split('Kindle').first
|
127
|
+
individual_details.clubs = doc.css(".recomnd")[8].text
|
128
|
+
individual_details.summary = doc.css(".midd .statement")[9].text.strip.gsub('â', "\'").gsub('Â', " ")
|
129
|
+
|
130
|
+
individual_details
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# Our CLI Controller
|
2
|
+
class BookClubPicks::CLI
|
3
|
+
|
4
|
+
def call
|
5
|
+
puts ""
|
6
|
+
puts "Welcome to Book Club Picks. You have come to the right place to find interesting books for your club to read. Browse through titles to find out more. Discover how many other clubs are currently reading that book!"
|
7
|
+
puts ""
|
8
|
+
puts "------------------------------"
|
9
|
+
puts ""
|
10
|
+
book_range
|
11
|
+
end
|
12
|
+
|
13
|
+
def book_range
|
14
|
+
puts "Here are this week's top 10 books."
|
15
|
+
puts "They are ranked in order of their current popularity on the Book Movement website."
|
16
|
+
puts ""
|
17
|
+
puts "------------------------------"
|
18
|
+
puts ""
|
19
|
+
BookClubPicks::Scraper.today
|
20
|
+
puts ""
|
21
|
+
puts "------------------------------"
|
22
|
+
puts ""
|
23
|
+
puts "Which book would you like to learn more about?"
|
24
|
+
puts "Enter 1-10 to read more information about each title."
|
25
|
+
puts "Enter exit when you are finished browsing."
|
26
|
+
puts ""
|
27
|
+
puts "------------------------------"
|
28
|
+
puts ""
|
29
|
+
menu
|
30
|
+
end
|
31
|
+
|
32
|
+
def menu
|
33
|
+
input = nil
|
34
|
+
while input != "exit"
|
35
|
+
puts ""
|
36
|
+
input = gets.strip.downcase
|
37
|
+
puts ""
|
38
|
+
puts "------------------------------"
|
39
|
+
|
40
|
+
if input.to_i > 0
|
41
|
+
case input
|
42
|
+
when "1"
|
43
|
+
puts ""
|
44
|
+
@individual_details = BookClubPicks::Book.scrape_details_1
|
45
|
+
book_details
|
46
|
+
when "2"
|
47
|
+
puts ""
|
48
|
+
@individual_details = BookClubPicks::Book.scrape_details_2
|
49
|
+
book_details
|
50
|
+
when "3"
|
51
|
+
puts ""
|
52
|
+
@individual_details = BookClubPicks::Book.scrape_details_3
|
53
|
+
book_details
|
54
|
+
when "4"
|
55
|
+
puts ""
|
56
|
+
@individual_details = BookClubPicks::Book.scrape_details_4
|
57
|
+
book_details
|
58
|
+
when "5"
|
59
|
+
puts ""
|
60
|
+
@individual_details = BookClubPicks::Book.scrape_details_5
|
61
|
+
book_details
|
62
|
+
when "6"
|
63
|
+
puts ""
|
64
|
+
@individual_details = BookClubPicks::Book.scrape_details_6
|
65
|
+
book_details
|
66
|
+
when "7"
|
67
|
+
puts ""
|
68
|
+
@individual_details = BookClubPicks::Book.scrape_details_7
|
69
|
+
book_details
|
70
|
+
when "8"
|
71
|
+
puts ""
|
72
|
+
@individual_details = BookClubPicks::Book.scrape_details_8
|
73
|
+
book_details
|
74
|
+
when "9"
|
75
|
+
puts ""
|
76
|
+
@individual_details = BookClubPicks::Book.scrape_details_9
|
77
|
+
book_details
|
78
|
+
when "10"
|
79
|
+
puts ""
|
80
|
+
@individual_details = BookClubPicks::Book.scrape_details_ten
|
81
|
+
book_details
|
82
|
+
end
|
83
|
+
elsif input == "exit"
|
84
|
+
goodbye
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def book_details
|
90
|
+
puts "Title: #{@individual_details.name}"
|
91
|
+
puts ""
|
92
|
+
puts "------------------------------"
|
93
|
+
puts ""
|
94
|
+
puts "#{@individual_details.published}"
|
95
|
+
puts ""
|
96
|
+
puts "------------------------------"
|
97
|
+
puts ""
|
98
|
+
puts "#{@individual_details.clubs}"
|
99
|
+
puts ""
|
100
|
+
puts "------------------------------"
|
101
|
+
puts ""
|
102
|
+
puts "#{@individual_details.summary}"
|
103
|
+
puts ""
|
104
|
+
puts "------------------------------"
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
def goodbye
|
109
|
+
puts ""
|
110
|
+
puts "------------------------------"
|
111
|
+
puts ""
|
112
|
+
puts "See you when you are ready for your next book!"
|
113
|
+
puts ""
|
114
|
+
puts "------------------------------"
|
115
|
+
puts ""
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class BookClubPicks::Scraper
|
2
|
+
|
3
|
+
def self.today
|
4
|
+
self.scrape_books
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.scrape_books
|
8
|
+
self.scrape_book_movement
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.scrape_book_movement
|
12
|
+
doc = Nokogiri::HTML(open("http://www.bookmovement.com/topClubPicks"))
|
13
|
+
current_books = []
|
14
|
+
|
15
|
+
doc.search("div.midd").each do |book|
|
16
|
+
current_books << book.search("h2").text
|
17
|
+
end
|
18
|
+
current_books.each_with_index do |book, index|
|
19
|
+
puts "#{index+1}. #{book}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: book_club_picks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jennifer Anton
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- jenanton01@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- CODE_OF_CONDUCT.md
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/book_club_picks
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- book_club_picks.gemspec
|
86
|
+
- lib/book_club_picks.rb
|
87
|
+
- lib/book_club_picks/books.rb
|
88
|
+
- lib/book_club_picks/cli.rb
|
89
|
+
- lib/book_club_picks/scraper.rb
|
90
|
+
- lib/book_club_picks/version.rb
|
91
|
+
homepage: https://github.com/sensei100/book_club_picks
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata:
|
95
|
+
allowed_push_host: https://rubygems.org
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
requirements: []
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 2.4.8
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: A command line interface that gives the user information about popular books.
|
116
|
+
test_files: []
|