adops_report_scrapper 0.2.49 → 0.2.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/adops_report_scrapper/lkqd_client.rb +11 -6
- data/lib/adops_report_scrapper/version.rb +1 -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: 6de3a02d1e5051fd19615c6fc6d5d1432aa742b2
|
4
|
+
data.tar.gz: d089277a918fd20d197ce5da57baff7f79943678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b91562fda2dfbb33607036b95fc1ded53f1dbf0cc5f42a86c7678aba3b9a96ecb6858ee4e8e1cf3e81c5f6fe057c46cc82deb0b9c05211ad1bfe80c3fea9e2
|
7
|
+
data.tar.gz: 2a90422537362a8b65543842847ab18b3b18f2f94ce4cdc4ac870b2d82fba76019f211f0c5d294ca73404fbc9f9fab643da72719375b7277f00a43c384b0dcec
|
data/CHANGELOG
CHANGED
@@ -9,6 +9,13 @@ class AdopsReportScrapper::LkqdClient < AdopsReportScrapper::BaseClient
|
|
9
9
|
false
|
10
10
|
end
|
11
11
|
|
12
|
+
def init_client
|
13
|
+
Capybara.register_driver :selenium do |app|
|
14
|
+
Capybara::Selenium::Driver.new(app, :browser => :firefox)
|
15
|
+
end
|
16
|
+
@client = Capybara::Session.new(:selenium)
|
17
|
+
end
|
18
|
+
|
12
19
|
private
|
13
20
|
|
14
21
|
def login
|
@@ -16,17 +23,15 @@ class AdopsReportScrapper::LkqdClient < AdopsReportScrapper::BaseClient
|
|
16
23
|
@client.fill_in 'Username', :with => @login
|
17
24
|
@client.fill_in 'Password', :with => @secret
|
18
25
|
@client.click_button 'Sign In'
|
26
|
+
sleep 10
|
19
27
|
begin
|
20
28
|
@client.find :xpath, '//*[text()="Run Report"]'
|
21
29
|
rescue Exception => e
|
22
30
|
raise e, 'Lkqd login error'
|
23
31
|
end
|
24
|
-
|
32
|
+
cookie = @client.evaluate_script('document.cookie').split('=')
|
25
33
|
@client = HTTPClient.new
|
26
|
-
@client.cookie_manager.cookies =
|
27
|
-
cookie = cookie.instance_variable_get(:@attributes)
|
28
|
-
HTTP::Cookie.new cookie
|
29
|
-
end
|
34
|
+
@client.cookie_manager.cookies = [ HTTP::Cookie.new(*cookie, :domain => '.lkqd.com', :path => '/') ]
|
30
35
|
end
|
31
36
|
|
32
37
|
def scrap
|
@@ -45,7 +50,7 @@ class AdopsReportScrapper::LkqdClient < AdopsReportScrapper::BaseClient
|
|
45
50
|
'endDate': @date_str,
|
46
51
|
'timeDimension': 'OVERALL',
|
47
52
|
'timezone': 'America/New_York',
|
48
|
-
'reportType': ['DOMAIN'],
|
53
|
+
'reportType': ['DOMAIN', 'DEVICE'],
|
49
54
|
'environmentIds': [1,2,3,4],
|
50
55
|
'filters': [],
|
51
56
|
'metrics': ["OPPORTUNITIES", "IMPRESSIONS", "REVENUE", "CLICKS", "COMPLETED_VIEWS"],
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adops_report_scrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.50
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stayman Hou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|