arb-bs 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/bs_pic +4 -4
  3. data/lib/arb/bs/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e0039dc4beb7f7f9990e28875084fc1448915f3
4
- data.tar.gz: 85368de8476a02dd5b46abdd17cb043afacd822c
3
+ metadata.gz: a02eb80cef7c1a3baa69df0dc4073eff58bcb7a8
4
+ data.tar.gz: d842b1b2c6beacf0a865b9a951547d90b88378bb
5
5
  SHA512:
6
- metadata.gz: 7dbf2a6b31a584e80cb249725daa1d7d3ce879c772227ff90126e01d3c4726ba9c8b20b6e0186d9b1f6eb8a601ae890c0a3579373e9c198f89b89b8a2c6b7fc7
7
- data.tar.gz: 6da38fadc1dc4dbf56dda3f1accf7e1432df646214088435dc1a504ee26ae6f8ff87ef218147f7f00726c5e9d88c790bce0a4dc546a81bf6ac7b4f76dde38603
6
+ metadata.gz: be58681e52eeca47ff7e55b3d1367a564e61065a7c6a6c8c05c3c40e1107a3224ab70ff50b7ed366726007f5014fce18676fa0f577e4d433937968415eaca520
7
+ data.tar.gz: 8597b048237f4a2008a435af7a17de2b40de4334355b478b557b50b1085a19703e1f4980b0be2e34ad987a84c72e2950605c03abda1ea4a313862133f6a12f81
data/exe/bs_pic CHANGED
@@ -6,15 +6,15 @@ include Arb
6
6
 
7
7
  domain='www.budejie.com'
8
8
  map_file='map.txt'
9
- max_page=ARGV[0] || 50
9
+ max_page=(ARGV[0] || 50).to_i
10
10
  #Minimun idle time(in seconds) between two complete rounds.
11
- min_idle_time=ARGV[1] || 600
11
+ min_idle_time=(ARGV[1] || 600).to_i
12
12
 
13
13
 
14
14
  File.open(map_file,'w+') unless File.exists? map_file
15
15
 
16
16
  loop do
17
- "http://#{domain}/pic/?".enum('?',1..max_page.to_i).each_with_index do |url,index|
17
+ "http://#{domain}/pic/?".enum('?',1..max_page).each_with_index do |url,index|
18
18
  Crawler.get_by_css(url,"div.j-r-list-c-img a img").each do |hash|
19
19
  url_file=Crawler.filename_of_url(hash[:"data-original"])
20
20
  unless File.readlines(map_file).find{|line| line.to_s.include? url_file}
@@ -30,7 +30,7 @@ loop do
30
30
  puts "Page round finished for page #{index+1}, next action in #{tmp} seconds later."
31
31
  sleep tmp
32
32
  end
33
- tmp=30+rand(30)
33
+ tmp=min_idle_time+rand(5)
34
34
  puts "Complete round finished, next action in #{tmp} seconds later."
35
35
  sleep tmp
36
36
  end
@@ -1,5 +1,5 @@
1
1
  module Arb
2
2
  module Bs
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arb-bs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - arybin