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.
- checksums.yaml +4 -4
- data/exe/bs_pic +4 -4
- data/lib/arb/bs/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: a02eb80cef7c1a3baa69df0dc4073eff58bcb7a8
|
4
|
+
data.tar.gz: d842b1b2c6beacf0a865b9a951547d90b88378bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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=
|
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
|
data/lib/arb/bs/version.rb
CHANGED