ruboty-bokete 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc271d55e38ae4c506c53c76168d450545ba3f1d
4
- data.tar.gz: 5f8dd41753c588f0d3396979d9c6d95e2b389135
3
+ metadata.gz: 6544c8b122280deebf01f0a342b3613668b7568e
4
+ data.tar.gz: 2035986702a98b650147b49d71870a94db8441a8
5
5
  SHA512:
6
- metadata.gz: 785ad5cccc11ed8e9cec90eeb71b4d147ba620fd7cddcde59b2cb1c75a4ff38a3a07619b19db2fe3f914d44a95b79dffbe515d82504c86bb3705bbe29dcd98d3
7
- data.tar.gz: 838b135ce6932b06cbe1c3889d1172744274edc7f4f800f1e39743f8891bb5f5ca59f2246dc2cc5214efd50ced5966860df9bcc30068584ab0b419495ec143ff
6
+ metadata.gz: 37dd6ebc7bb3643fce701cf2ce89619487bdd10b90564a8cd192658c5717e0cf724ade98772fbf8e6436a29ecd3a501223a305233625f8bcc4989a96d4c45fec
7
+ data.tar.gz: 2df59c9df61898c661ae41ec034999065d25085adaee225dbf8350bea7482585b3480739823d43b3dc3caf81b685f8f06d8fb772df4a90aaaf8c849f751b5c09
@@ -5,24 +5,25 @@ class Client
5
5
 
6
6
  def initialize(max_results: 30)
7
7
  @max_results = max_results
8
- @results = []
9
8
  @agent = Mechanize.new
10
9
  end
11
10
 
12
11
  def get(mode)
12
+ results = []
13
+
13
14
  @agent.get("#{BOKETE_URL}/boke/#{mode}") do |page|
14
15
  target_page = page
15
16
 
16
- while @results.size < @max_results
17
+ while results.size < @max_results
17
18
  images = scraping_from_page(target_page)
18
- @results.concat(images)
19
+ results.concat(images)
19
20
 
20
21
  target_page = get_next_page(target_page)
21
22
  break if target_page.nil?
22
23
  end
23
24
  end
24
25
 
25
- @results
26
+ results
26
27
  end
27
28
 
28
29
  def scraping_from_page(page)
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Bokete
3
- VERSION = '0.0.1'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-bokete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-11 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty