ruboty-bokete 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/bokete/client.rb +3 -2
- data/lib/ruboty/bokete/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1eebf20d27d177d309e6cc2d6288a10046179ca
|
4
|
+
data.tar.gz: 29a6ef0c2ec918843779a074008b3e1889573d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b851b4610f2c6d2d771f72c5dfd9c78b1ac3ebc59ddf2bb52685696b69d6544d27026c54fbd39ec9283ffe60a0fb190062b088fd09e00275a546bb4c3966e88
|
7
|
+
data.tar.gz: 97d0440f421e7a07bebea2043593263a4072dffd9b0d7173df7e3573355e501a7ae9220d17a42ed909a170dc3c0e5a42cacc7e76b431171099ff0c31b6fd9ea5
|
data/lib/ruboty/bokete/client.rb
CHANGED
@@ -18,6 +18,7 @@ module Ruboty
|
|
18
18
|
|
19
19
|
while results.size < @max_results
|
20
20
|
images = scraping_from_page(target_page)
|
21
|
+
p images
|
21
22
|
results.concat(images)
|
22
23
|
|
23
24
|
target_page = get_next_page(target_page)
|
@@ -29,7 +30,7 @@ module Ruboty
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def scraping_from_page(page)
|
32
|
-
page.search('.boke').map
|
33
|
+
page.search('.boke').map {|node|
|
33
34
|
node.children.each_with_object({}) do |child, hash|
|
34
35
|
case child.name
|
35
36
|
when 'div'
|
@@ -39,7 +40,7 @@ module Ruboty
|
|
39
40
|
hash[:boke] = child.text
|
40
41
|
end
|
41
42
|
end
|
42
|
-
|
43
|
+
}.reject(&:empty?)
|
43
44
|
end
|
44
45
|
|
45
46
|
def get_next_page(page)
|