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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b92b052395f7b0b3e1514195156f607ffc45e76
4
- data.tar.gz: 6b57e79da369dc3e9afc7adf8f230defaec7aa33
3
+ metadata.gz: 6de3a02d1e5051fd19615c6fc6d5d1432aa742b2
4
+ data.tar.gz: d089277a918fd20d197ce5da57baff7f79943678
5
5
  SHA512:
6
- metadata.gz: fca64719b0d63f7bd408050cd679bd9c77d9f632a5e44b88c24e7e1d8ff7c0791402a8a1413301129940a35edd1e7c2de7ff7b5e2e6b692ad01817ecd88dca8c
7
- data.tar.gz: bc05a85aeb352a1deb419779edfd25a245d4dcbe6d98fd7ef106960b618dea2e0fe629436965e1ea8b9113fe0d322c44c1d502b7330451742bae1cf09a4a9f57
6
+ metadata.gz: d5b91562fda2dfbb33607036b95fc1ded53f1dbf0cc5f42a86c7678aba3b9a96ecb6858ee4e8e1cf3e81c5f6fe057c46cc82deb0b9c05211ad1bfe80c3fea9e2
7
+ data.tar.gz: 2a90422537362a8b65543842847ab18b3b18f2f94ce4cdc4ac870b2d82fba76019f211f0c5d294ca73404fbc9f9fab643da72719375b7277f00a43c384b0dcec
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.50
4
+ fix for lkqd recent ui update
5
+ add device breakdown for lkqd
6
+
3
7
  ## 0.2.49
4
8
  fix for aol legacy report
5
9
 
@@ -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
- cookies = @client.driver.cookies
32
+ cookie = @client.evaluate_script('document.cookie').split('=')
25
33
  @client = HTTPClient.new
26
- @client.cookie_manager.cookies = cookies.values.map do |cookie|
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"],
@@ -1,3 +1,3 @@
1
1
  module AdopsReportScrapper
2
- VERSION = "0.2.49"
2
+ VERSION = "0.2.50"
3
3
  end
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.49
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-02-07 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient