coding_resources 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/lib/coding_resources.rb +1 -0
- data/lib/coding_resources/scraper.rb +2 -1
- data/lib/coding_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38843bc4045122b6643160f8758a506910ebd182daac0daffac30e1febbc1b20
|
4
|
+
data.tar.gz: eb28f7dd2eddec91f1fa79717c83e716a55a77a24ee812c9a3953269d205fab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8068e8c86d4b13fec48d703d3f1473af066c7e39c3f040a0eaad4beb2272c70f66469e75e627e48f6eba572e7b296b59ea45f95ec097b59fecb0f1457bc1bebc
|
7
|
+
data.tar.gz: 1c2966baf5cf59e98fb28aaffa2e99cf3e19d1f7fe163b8927e0d844546305f48097a2b8ab1ad48c86d80821b23f52e557e1f38bc6b8ca22d72a65ae556f6767
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -17,10 +17,10 @@ And then execute:
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
19
19
|
$ gem install coding_resources
|
20
|
+
|
21
|
+
# Usage
|
20
22
|
|
21
|
-
##
|
22
|
-
|
23
|
-
##After installation run gem by typing "coding_resources" into the terminal, then:
|
23
|
+
## After installation run gem by typing "coding_resources" into the terminal, then:
|
24
24
|
|
25
25
|
Type 1 to list all books.
|
26
26
|
|
@@ -28,7 +28,7 @@ Type 2 to search for a book.
|
|
28
28
|
|
29
29
|
Type 3 to exit.
|
30
30
|
|
31
|
-
##After listing or searching for a book:
|
31
|
+
## After listing or searching for a book:
|
32
32
|
|
33
33
|
Type 1 to get more details on a book.
|
34
34
|
|
@@ -42,7 +42,7 @@ Type 5 to search for a new book.
|
|
42
42
|
|
43
43
|
Type 6 to exit.
|
44
44
|
|
45
|
-
##After getting details on a specific book:
|
45
|
+
## After getting details on a specific book:
|
46
46
|
|
47
47
|
Type 1 to go back to the list of books.
|
48
48
|
|
data/lib/coding_resources.rb
CHANGED
@@ -3,7 +3,8 @@ class CodingResources::Scraper
|
|
3
3
|
def self.scrape_all_books
|
4
4
|
page = 0
|
5
5
|
books = []
|
6
|
-
|
6
|
+
last_page = Nokogiri::HTML(open("http://www.freetechbooks.com/topics")).css(".pagination li")[-2].text.to_i + 1
|
7
|
+
while page < last_page
|
7
8
|
page += 1
|
8
9
|
doc = Nokogiri::HTML(open("http://www.freetechbooks.com/topics?page=#{page}"))
|
9
10
|
doc.css(".media-body").each do |book|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coding_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Christopher Jones'"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|