adops_report_scrapper 0.2.29 → 0.2.30

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: 18fe8a9e5d0db433253503138f2d03cd1adee71b
4
- data.tar.gz: 73d73a41e74cc15520aae6427901fecdbbae1f73
3
+ metadata.gz: f49084c7ee64585fff30a1ae1ea1ccd554c864cd
4
+ data.tar.gz: 00e1f92e1a64a9cd63faa6c73576dd46efc1cb37
5
5
  SHA512:
6
- metadata.gz: e4fc3188f3b828f25b35217569a71e1f368df3f18acfc896f5bd3098889c6b4d25ca38dd31ab998b1acf2eb616e2e78cce6ae989e94522760ac28ebe7c1daec7
7
- data.tar.gz: 15ff71dd798cd90ee71e83fe632d8c95af18ca418dc750b417090282666af8909fbb4aba5382f807a910dc39fd428c47e86bcb4ecf02d637ca871aa362573d9a
6
+ metadata.gz: 02bf5233112d6fc6be7fa06ca2be8a55d0f1577be38072396310782a77105a0774f7072840b6078fb4acfdba5de904b0be0a17cb29a4258f059d9757eb4421be
7
+ data.tar.gz: a8aee043c69249a8a6c7797573dcf1c3efc55b93c2d9b1678a2f984fe89d5fa05e0eed6b6484e8366658ed7cc0f2aebe95bb24e6cf3e8f36ce5caabcf7cde448
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.30
4
+ make rhythmone more robust
5
+
3
6
  ## 0.2.29
4
7
  fix sovrn
5
8
 
@@ -33,12 +33,17 @@ class AdopsReportScrapper::RhythmoneClient < AdopsReportScrapper::BaseClient
33
33
  def scrap
34
34
  date_str = @date.strftime('%Y%m%d')
35
35
  data_obj = nil
36
+ flag_valid_data_found = false
36
37
  5.times do
37
38
  response = HTTPClient.get("https://api.portal.rhythmone.com/v1/publishers/#{@publisher_id}/reports/standard_report", { ad_dimension: 0, endDate: date_str, endDateType: 1, groupBy1: 1, groupByTimePeriodType: 1, rmp_placement: 0, startDate: date_str, startDatePredefined: 0, startDateType: 1 }, { 'Authorization' => "Bearer #{@access_token}" })
38
39
  data_obj = JSON.parse response.body
39
- break if data_obj.is_a? Array
40
+ if data_obj.is_a?(Array) && !response.body.include? 'Data is still processing'
41
+ flag_valid_data_found = true
42
+ break
43
+ end
40
44
  sleep 5
41
45
  end
46
+ fail 'rhythmone report failed' unless flag_valid_data_found
42
47
  @data = data_obj
43
48
  end
44
49
  end
@@ -1,3 +1,3 @@
1
1
  module AdopsReportScrapper
2
- VERSION = "0.2.29"
2
+ VERSION = "0.2.30"
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.29
4
+ version: 0.2.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stayman Hou
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-10 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient