gooddata_eloqua 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5b572c9c0cbddccb6666c0d0f2319f4b8fff155
4
- data.tar.gz: 059040688e5d8328c6f10ea73031b3f1b28a8a9c
3
+ metadata.gz: c44b61d7f5b03be69a4313395f9c5945fca8245f
4
+ data.tar.gz: 7703791ac30e6253fd913575bdb656064e859d6c
5
5
  SHA512:
6
- metadata.gz: 24e1bef63bc48c72174727b5fba6464c1f26d487f23ce730b66d516f05a6436bb76a7bb3c3054dbc2601805705575742e57bc852190a2aa16ca3e4f7e854af43
7
- data.tar.gz: 158ff24551b0b092e29ef9067c1b129234c3a5e89e8932afca3a4364ac0709fcc5d8607e2da688d34ad9a279721d24f0fa57e2620966f888d3b2bcf7a604869d
6
+ metadata.gz: 87d54e5d7b778ab78864da5cc7f463f0c0f0c5bfeff5f0ae2512d40ef1ea592e054cc29b10e3984342b44695a033db8078a196d8e517bfdebcba536a80dff372
7
+ data.tar.gz: 086dc989ce4be40123781948043e8b298e2b855edc9a284811cfdb1fc86aeaca9e07d9234d2eb7813db8efce54635b9cf9e26c1745867b51b85056b7f576a4db
@@ -29,6 +29,10 @@ class GoodDataEloqua::Client
29
29
  GoodDataEloqua::Contacts.new(config)
30
30
  end
31
31
 
32
+ def forms(config={})
33
+ GoodDataEloqua::Forms.new(config)
34
+ end
35
+
32
36
  def system_check(refresh = false)
33
37
 
34
38
  if refresh
@@ -47,3 +51,4 @@ require_relative 'helpers/request'
47
51
  require_relative 'models/campaigns'
48
52
  require_relative 'models/emails'
49
53
  require_relative 'models/contacts'
54
+ require_relative 'models/forms'
@@ -31,20 +31,35 @@ class GoodDataEloqua::Request
31
31
 
32
32
  def write_all_ids_return_csv(file_name, config={})
33
33
 
34
+
34
35
  if file_name
35
36
  fd = IO.sysopen("./downloads/#{file_name}", 'w+')
36
37
  end
37
38
 
38
39
  csv = CSV.new(IO.new(fd))
39
- analyze = self.get_all_by_page(0)
40
- pages = analyze['total'].to_i
40
+
41
+ first_download = self.get_all_by_page(0)
42
+ pages = first_download['total'].to_i
41
43
  total = (pages/1000).round
42
44
 
43
45
  total = 1 if total == 0
44
46
 
45
- self.get_all_distributed total, csv
46
- puts "\n#{Time.now} => Flushing IO (#{@session_csv}.id)..."
47
+ if total == 1
48
+
49
+ first_download['elements'].each { |record|
50
+ csv << [record['id']]
51
+ }
52
+
53
+ csv.flush
47
54
 
55
+ puts "\n#{Time.now} => Flushing IO (#{@session_csv}.id)..."
56
+
57
+ else
58
+
59
+ self.get_all_distributed total, csv
60
+ puts "\n#{Time.now} => Flushing IO (#{@session_csv}.id)..."
61
+
62
+ end
48
63
 
49
64
  file_name
50
65
 
@@ -0,0 +1,15 @@
1
+
2
+ class GoodDataEloqua::Forms < GoodDataEloqua::Request
3
+
4
+ def initialize(config={})
5
+ @client = $client
6
+
7
+ @client = $client
8
+ @session_id = SecureRandom.hex+"_forms"
9
+ @session_csv = @session_id+".csv"
10
+ self.set_asset_type('forms')
11
+
12
+ end
13
+
14
+
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gooddata_eloqua
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McConlogue
@@ -94,6 +94,7 @@ files:
94
94
  - lib/gooddata_eloqua/models/campaigns.rb
95
95
  - lib/gooddata_eloqua/models/contacts.rb
96
96
  - lib/gooddata_eloqua/models/emails.rb
97
+ - lib/gooddata_eloqua/models/forms.rb
97
98
  homepage: https://github.com/thnkr/connectors/tree/master/eloqua
98
99
  licenses:
99
100
  - MIT