ppc 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ppc.rb +1 -1
- data/lib/ppc/api/baidu.rb +1 -1
- data/lib/ppc/api/qihu/plan.rb +2 -2
- data/lib/ppc/api/sogou/bulk.rb +3 -1
- data/lib/ppc/api/sogou/report.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 770db96f31a2d738d9f4918852017a4d9f2a6c30
|
4
|
+
data.tar.gz: 6f4da699a833ac12ba58d62dfe9afffacf2be467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0078aa233faf95529606a806343bdc53172e0feea53d090cac35553d2ea39a6083d36eacaa3407b64e829dee479564e01256a29b2a8bbb905f29738d3262ed16
|
7
|
+
data.tar.gz: 8bdb1364278a17a5b313ce3a69761adef394140591848b4003d0ef3ff19bc68d4a136d307dd54cdf3f6fab08b30bbc6d87bdd2a2ab9951a6391e2886f9fc764e
|
data/lib/ppc.rb
CHANGED
data/lib/ppc/api/baidu.rb
CHANGED
@@ -35,7 +35,7 @@ module PPC
|
|
35
35
|
result[:failure] = response['header']['failures']
|
36
36
|
result[:result] ||= func[ response['body']['data'] ] rescue nil
|
37
37
|
result[:rquota] = response['header']['rquota'] if response['header']['rquota']
|
38
|
-
result[:no_quota] = (response['header']['failures']['code'] == '8501') rescue
|
38
|
+
result[:no_quota] = (response['header']['failures']['code'] == '8501') rescue false
|
39
39
|
result
|
40
40
|
end
|
41
41
|
|
data/lib/ppc/api/qihu/plan.rb
CHANGED
@@ -71,11 +71,11 @@ module PPC
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def self.enable( auth, id )
|
74
|
-
self.update(auth, {id: id[0], pause: "enable"})
|
74
|
+
self.update(auth, [{id: id[0], pause: "enable"}])
|
75
75
|
end
|
76
76
|
|
77
77
|
def self.pause( auth, id )
|
78
|
-
self.update(auth, {id: id[0], pause: "pause"})
|
78
|
+
self.update(auth, [{id: id[0], pause: "pause"}])
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
data/lib/ppc/api/sogou/bulk.rb
CHANGED
@@ -58,10 +58,12 @@ module PPC
|
|
58
58
|
def self.download_cpc_rank(auth, device = 0)
|
59
59
|
result = get_cpc_rank(auth, device)
|
60
60
|
rank_id = result[:result]
|
61
|
+
times = 0
|
61
62
|
loop do
|
63
|
+
raise "The speed of get_status is too slow." if (times += 1) > 10
|
62
64
|
status = get_cpc_rank_status(auth, rank_id)
|
63
65
|
return get_cpc_rank_path(auth, rank_id) if status[:result] == '1'
|
64
|
-
sleep
|
66
|
+
sleep 10
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
data/lib/ppc/api/sogou/report.rb
CHANGED
@@ -68,10 +68,12 @@ module PPC
|
|
68
68
|
if response[:succ]
|
69
69
|
id = response[:result]
|
70
70
|
p "Got report id:" + id.to_s if debug
|
71
|
+
times = 0
|
71
72
|
loop do
|
72
|
-
|
73
|
+
raise "The speed of get_status is too slow." if (times += 1) > 10
|
73
74
|
break if get_state( auth, id )[:result] == 'Finished'
|
74
75
|
p "Report is not generated, waiting..." if debug
|
76
|
+
sleep 5
|
75
77
|
end
|
76
78
|
|
77
79
|
url = get_url( auth, id )[:result]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chienli Ma
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-09-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|