zuck 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG.markdown +35 -5
  3. data/Gemfile +3 -2
  4. data/Gemfile.lock +13 -10
  5. data/README.markdown +26 -38
  6. data/VERSION +1 -1
  7. data/console +8 -2
  8. data/lib/zuck/facebook/ad_account.rb +22 -5
  9. data/lib/zuck/facebook/ad_campaign.rb +12 -15
  10. data/lib/zuck/facebook/ad_creative.rb +14 -14
  11. data/lib/zuck/facebook/ad_group.rb +12 -12
  12. data/lib/zuck/facebook/ad_interest.rb +12 -15
  13. data/lib/zuck/facebook/ad_set.rb +30 -0
  14. data/lib/zuck/facebook/targeting_spec.rb +4 -4
  15. data/lib/zuck/fb_object/dsl.rb +15 -7
  16. data/lib/zuck/fb_object/hash_delegator.rb +20 -3
  17. data/lib/zuck/fb_object/write.rb +18 -6
  18. data/lib/zuck/fb_object.rb +1 -1
  19. data/lib/zuck/helpers.rb +20 -1
  20. data/spec/fixtures/a_single_account.yml +146 -29
  21. data/spec/fixtures/a_single_campaign.yml +61 -12
  22. data/spec/fixtures/a_single_group.yml +65 -12
  23. data/spec/fixtures/ad_interest_search_disney.yml +16 -14
  24. data/spec/fixtures/ad_interest_search_moviepilot.yml +15 -98
  25. data/spec/fixtures/ad_interest_search_nonexistant.yml +7 -5
  26. data/spec/fixtures/create_ad_campaign.yml +334 -9
  27. data/spec/fixtures/create_ad_group.yml +154 -9
  28. data/spec/fixtures/create_ad_set.yml +95 -0
  29. data/spec/fixtures/delete_ad_group.yml +55 -8
  30. data/spec/fixtures/find_a_single_group_and_update_it.yml +122 -95
  31. data/spec/fixtures/list_of_ad_accounts.yml +77 -58
  32. data/spec/fixtures/list_of_ad_campaigns.yml +77 -55
  33. data/spec/fixtures/list_of_ad_creatives.yml +61 -13
  34. data/spec/fixtures/list_of_ad_groups.yml +77 -60
  35. data/spec/fixtures/list_of_all_ad_creatives_of_account.yml +77 -73
  36. data/spec/fixtures/reach_for_invalid_interest.yml +29 -111
  37. data/spec/fixtures/reach_for_valid_keywords.yml +11 -54
  38. data/spec/fixtures/reach_for_valid_keywords_male_young.yml +11 -60
  39. data/spec/lib/zuck/facebook/ad_account_spec.rb +1 -1
  40. data/spec/lib/zuck/facebook/ad_interest_spec.rb +2 -2
  41. data/spec/lib/zuck/facebook/targeting_spec_spec.rb +13 -21
  42. data/spec/lib/zuck_spec.rb +34 -23
  43. data/spec/spec_helper.rb +2 -5
  44. data/test_access_token +1 -0
  45. data/zuck.gemspec +15 -9
  46. metadata +63 -46
@@ -59,11 +59,23 @@ module Zuck
59
59
  # the ad account your campaign is part of.
60
60
  #
61
61
  # @param type [Symbol] Pass an underscored symbol here, for example
62
- # `ad_account`
63
- def parent_object(type)
62
+ # `:ad_account`
63
+ def parent_object(type, options = {})
64
+
65
+ # The `Read` module uses this
64
66
  @parent_object_type = type.to_s
67
+
65
68
  define_method(type) do
66
- @parent_object
69
+ # Why a lambda? Because it gets evaluated on runtime, not now. This is a
70
+ # good thing because it allows for randomly loading files with classes
71
+ # that inherit from FbObject.
72
+ class_resolver = lambda{"Zuck::#{type.to_s.singularize.camelize}".constantize}
73
+
74
+ if options[:as]
75
+ @parent_object ||= class_resolver.call.new(@graph, {id: send(options[:as])}, nil)
76
+ else
77
+ @parent_object
78
+ end
67
79
  end
68
80
  end
69
81
 
@@ -86,10 +98,6 @@ module Zuck
86
98
  # forward to `Ding.new` and `Dong.new`.
87
99
  def connections(*args)
88
100
  args.each do |c|
89
-
90
- # Why a lambda? Because it gets evaluated on runtime, not now. This is a
91
- # good thing because it allows for randomly loading files with classes
92
- # that inherit from FbObject.
93
101
  class_resolver = lambda{"Zuck::#{c.to_s.singularize.camelize}".constantize}
94
102
 
95
103
  # Define getter for connections
@@ -58,7 +58,7 @@ module Zuck
58
58
  # Define getter
59
59
  self.send(:define_method, key) do
60
60
  init_hash
61
- @hash_delegator_hash[key]
61
+ send('[]', key)
62
62
  end
63
63
 
64
64
  # Define setter
@@ -77,7 +77,12 @@ module Zuck
77
77
  d.each do |key, value|
78
78
  hash[(key.to_sym rescue key) || key] = value
79
79
  end
80
- @hash_delegator_hash = hash
80
+ @hash_delegator_hash = hash.symbolize_keys
81
+ end
82
+
83
+ def merge_data(d)
84
+ init_hash
85
+ @hash_delegator_hash.merge!(d.symbolize_keys)
81
86
  end
82
87
 
83
88
  def data=(d)
@@ -90,7 +95,9 @@ module Zuck
90
95
 
91
96
  def [](key)
92
97
  init_hash
93
- @hash_delegator_hash[key.to_sym]
98
+ k = key.to_sym
99
+ reload_once_on_nil_value(k)
100
+ @hash_delegator_hash[k]
94
101
  end
95
102
 
96
103
  def []=(key, value)
@@ -111,5 +118,15 @@ module Zuck
111
118
  def init_hash
112
119
  @hash_delegator_hash ||= {}
113
120
  end
121
+
122
+ # For a hash that has been initialized with only an id,
123
+ # lazy reload from facebook when a nil attribute is accessed
124
+ # (but only do that once)
125
+ def reload_once_on_nil_value(key)
126
+ return if @hash_delegator_reloaded_once
127
+ return if @hash_delegator_hash[key.to_sym]
128
+ @hash_delegator_reloaded_once = true
129
+ reload
130
+ end
114
131
  end
115
132
  end
@@ -24,9 +24,9 @@ module Zuck
24
24
  #
25
25
  # Since we only put one at a time, we'll fetch this like that.
26
26
  data = result["data"].values.first.values.first
27
+ known_data = data.keep_if{|k,v| known_keys.include?(k.to_sym) }
27
28
 
28
- # Update and return
29
- set_data(data)
29
+ merge_data(known_data)
30
30
  result["result"]
31
31
  end
32
32
 
@@ -50,14 +50,26 @@ module Zuck
50
50
  data["redownload"] = 1
51
51
 
52
52
  # Create
53
- result = create_connection(graph, p, list_path, data)["data"]
53
+ result = create_connection(graph, p, list_path, data)
54
54
 
55
- # The data is nested by name and id, e.g.
55
+ # If the redownload flag was supported, the data is nested by
56
+ # name and id, e.g.
56
57
  #
57
58
  # "campaigns" => { "12345" => "data" }
58
59
  #
59
- # Since we only put one at a time, we'll fetch this like that.
60
- data = result.values.first.values.first
60
+ # Since we only create one at a time, we can just say:
61
+ if d=result['data']
62
+ data = d.values.first.values.first
63
+
64
+ # Redownload was not supported, in this case facebook returns
65
+ # just {"id": "12345"}
66
+ elsif result['id']
67
+ data = result
68
+
69
+ # Don't know what to do. No id and no data. I need an adult.
70
+ else
71
+ raise "Invalid response received, found neither a data nor id key in #{result}"
72
+ end
61
73
 
62
74
  # Return a new instance
63
75
  new(graph, data, parent)
@@ -16,9 +16,9 @@ module Zuck
16
16
  # class AdCampaign < FbObject
17
17
  #
18
18
  # known_keys :title, :budget
19
- # parent_object :ad_account
20
19
  # list_path :adcampaigns
21
20
  # connections :ad_groups
21
+ # parent_object :ad_account, as: :account_id
22
22
  #
23
23
  # end
24
24
  #
data/lib/zuck/helpers.rb CHANGED
@@ -1,11 +1,30 @@
1
1
  module Zuck
2
2
  module Helpers
3
+
4
+ # Facebook returns 'account_ids' without the 'act_' prefix,
5
+ # so we have to treat account_ids special and make sure they
6
+ # begin with act_
7
+ def normalize_account_id(id)
8
+ return id if id.to_s.start_with?('act_')
9
+ "act_#{id}"
10
+ end
11
+
3
12
  def normalize_array(arr)
4
- [arr].flatten.compact.map(&:to_s).uniq.sort
13
+ [arr].flatten.compact.uniq.sort
5
14
  end
6
15
 
7
16
  def normalize_countries(countries)
8
17
  normalize_array(countries).map(&:upcase)
9
18
  end
19
+
20
+ def values_from_string_or_object_interests(interests)
21
+ [interests].flatten.map do |interest|
22
+ if interest.is_a?(String)
23
+ interest
24
+ else
25
+ interest[:name] || interest['name']
26
+ end
27
+ end
28
+ end
10
29
  end
11
30
  end
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/act_10150585630710217?access_token=CAAEvJ5vzhl8BAH8aCPOx0Ft9uNB147TF8weJ8hK0g7YVDRWU4eEih7tEKdJgmfk0vABZClZACJbEzyhSMbiShL6RpsfkZASfX1C9nv1AlFvjJajflqkyYZAlpE2edT0FJHjdh4NFg0ZCt0sBgq0kZABtKsjuU18aMURLE7rjKHR4X8NkXBUafg1T4uZARRNqboZD&fields=account_groups,account_id,account_status,age,agency_client_declaration,amount_spent,balance,business_city,business_country_code,business_name,business_state,business_street2,business_street,business_zip,capabilities,currency,daily_spend_limit,id,is_personal,name,spend_cap,timezone_id,timezone_name,timezone_offset_hours_utc,tos_accepted,users,vat_status
5
+ uri: https://graph.facebook.com/act_10150585630710217?access_token=CAAEvJ5vzhl8BANgaZCvjMZCRsIbNZCSPswoDM0MTx8g30ojs53HUp43aVBVdqHnu9kIFytWIR5oRfp1Sy8DZBtJ9p5Rw2kY93ZAu6EwzHqZCrjmeBxXBWWlMCty1Bg4zKc3abdbjgoX4fWP4NWCEyWZCFJBKXWR0WV3ZC63bSqw7ojzYJm4teOarRc1GaesGIlIKlZB6s7EwZA1qUZCCKsdZCSsq%0A&fields=account_groups,account_id,account_status,age,agency_client_declaration,amount_spent,balance,business_city,business_country_code,business_name,business_state,business_street2,business_street,business_zip,capabilities,created_time,currency,daily_spend_limit,end_advertiser,funding_source,funding_source_details,id,is_personal,media_agency,name,offsite_pixels_tos_accepted,partner,spend_cap,timezone_id,timezone_name,timezone_offset_hours_utc,tos_accepted,users,tax_id_status
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.8.7
11
+ - Faraday v0.8.9
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -16,35 +16,152 @@ http_interactions:
16
16
  response:
17
17
  status:
18
18
  code: 200
19
- message: OK
19
+ message: !binary |-
20
+ T0s=
20
21
  headers:
21
- Access-Control-Allow-Origin:
22
- - ! '*'
23
- Cache-Control:
24
- - private, no-cache, no-store, must-revalidate
25
- Content-Type:
26
- - application/json; charset=UTF-8
27
- Etag:
28
- - ! '"3974cd2e1bd6adde467a920e740351a73e2d5889"'
29
- Expires:
30
- - Sat, 01 Jan 2000 00:00:00 GMT
31
- Pragma:
32
- - no-cache
33
- X-Fb-Rev:
34
- - '934677'
35
- X-Fb-Debug:
36
- - X2mEeMJUPl6v6oa677ct5KWrnQJIEqYykFRDw7P1OOE=
37
- Date:
38
- - Thu, 12 Sep 2013 13:21:40 GMT
39
- Connection:
40
- - keep-alive
41
- Content-Length:
42
- - '697'
22
+ !binary "RmFjZWJvb2stQXBpLVZlcnNpb24=":
23
+ - !binary |-
24
+ djEuMA==
25
+ !binary "RXRhZw==":
26
+ - !binary |-
27
+ Ijg5NTEyYmVhYWU5YjU3MmVlOWJmYzc2NWUyMmFmNDE5N2JlMzhiNGQi
28
+ !binary "Q29udGVudC1UeXBl":
29
+ - !binary |-
30
+ YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOA==
31
+ !binary "UHJhZ21h":
32
+ - !binary |-
33
+ bm8tY2FjaGU=
34
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctT3JpZ2lu":
35
+ - !binary |-
36
+ Kg==
37
+ !binary "WC1GYi1SZXY=":
38
+ - !binary |-
39
+ MTUzNDg4NA==
40
+ !binary "Q2FjaGUtQ29udHJvbA==":
41
+ - !binary |-
42
+ cHJpdmF0ZSwgbm8tY2FjaGUsIG5vLXN0b3JlLCBtdXN0LXJldmFsaWRhdGU=
43
+ !binary "RXhwaXJlcw==":
44
+ - !binary |-
45
+ U2F0LCAwMSBKYW4gMjAwMCAwMDowMDowMCBHTVQ=
46
+ !binary "Q29udGVudC1FbmNvZGluZw==":
47
+ - !binary |-
48
+ Z3ppcA==
49
+ !binary "WC1GYi1EZWJ1Zw==":
50
+ - !binary |-
51
+ cnlkUVZZRmpTdzZVdHpaY1ArMFJwc2ZtR1hwZTR0aHJSQnpRTkY2eHB1eElk
52
+ SHZKUThvUlI4eUUrT0F5MWFNSHZsVHcrNmpBdnpQaHkyS09LM0F6ZlE9PQ==
53
+ !binary "RGF0ZQ==":
54
+ - !binary |-
55
+ V2VkLCAxNyBEZWMgMjAxNCAxMjozNjozNiBHTVQ=
56
+ !binary "Q29ubmVjdGlvbg==":
57
+ - !binary |-
58
+ a2VlcC1hbGl2ZQ==
59
+ !binary "Q29udGVudC1MZW5ndGg=":
60
+ - !binary |-
61
+ Nzky
62
+ body:
63
+ encoding: ASCII-8BIT
64
+ string: !binary |-
65
+ H4sIAAAAAAAAA6VUwW6bQBD9FYtTq5J0wWAS37DZEGobEGCnaROtNrC2V8GA
66
+ 2EWKE+XfO4udyG0q9dATaObNzOMxb140mud1V0nCC22sGciwkX1hj4bIMZBp
67
+ OJr+DhCSyk5oYwNCGwZPZBvnFyPHcOxL076E6O6Aa1gltbGNENK1B1rSKge0
68
+ eu8Er5gQJOdyD8MmrC15pZ0mVIN2D88CSjQPnyYrulPBCd8MFvyRDdyy5Zut
69
+ HCz9wactXcuu2ogHJvJte9chxKzqUX4+rVf8+wYfxgrZMiZNyH07lG5YWxV1
70
+ u2bt4AfjJRuMjI/4/+HyzBultmmiSwjntKEPvOSSM9D3pxYneBEsF5AJ8Q2Z
71
+ uovYDfyQpFmynGbLRKmyiCbBHBPXW+EkC1KckMAjy3geuR5k51E0c+fBrAe4
72
+ 4RR7ZBqFV4EPuTiJEjeDyGTp+TiDSHR1lQYZVhDolgZRSK4D/5pMAtXrbVIc
73
+ kwTj0Hd9vMBhBp3TnuAsIh5OZ1kUA9Nw5aY99JA9qV0FHo6OYcCRZYpJsAAy
74
+ K6Di4wjC16p25QZzdwJFsXvbz1ng7Dr6rezYFX/PcBK6c0D6mGS3sdLlnxhy
75
+ FSVkHscn2GjuAbE+q8b0NDyS4oxkbgISBaHS7Q19+BBglQTTlEwS7M686CbU
76
+ 7uE/tgxWrCCS95tqIsM4Q9aZaWcmGpvG2HK+IBMh9ce7tmVVrlywTJXKBeXl
77
+ vrdOQUq+47BdhnIQ2GbdVQWvNkTUXaucpA2dC2SZQ8MeWbbpWNqfEFIwCe1g
78
+ lV603tUfCwoumpLu1SZDHUBiuo9pOTh6HZaYlWWtdtdCm/1uy9qaNs15Xu/U
79
+ Gst9o/w/fNUP/Wkuyd8uBxekYa2oK1r2B+DoYMjU67XgkpGGP7FSEFkLAqNZ
80
+ A+pp4zUtBdO1gxjgjbdbomR9rivWnyrLOQkcG+OurRt29/Xd4e8ANY9JsgV9
81
+ BOlk3l+xTgA5JVJBJQXfHdWykeEM4QtG0ADo77gQvK6UMQ3d1Ie6pdu6A3+7
82
+ rcv+CiLj9R6UkPQJiL1fyeHrL2ctojhbBQAA
83
+ http_version:
84
+ recorded_at: Wed, 17 Dec 2014 12:36:36 GMT
85
+ - request:
86
+ method: get
87
+ uri: https://graph.facebook.com/act_10150585630710217?access_token=CAAEvJ5vzhl8BAICOwypV5nYnYWXhBq1eskHA7rKyrz9fXcAvKRXDWVZAaG7FpQ21qTXeCtGZCR7iu1dtZCqZCZBZCQbefKrMOnZAibDZAiQKiX0s22PgtKuCoQK4LDVimREnqkGdoLMyB4zgT3A6ZAU7pn6wc2mTzZBWVbkr71bZBJKjhyeb4V58TkMsUbN9SQer3ZCRRtWTxqNFTUwHuv51RoVsI7LNw0mCr5gZD%0A&fields=account_groups,account_id,account_status,age,agency_client_declaration,amount_spent,balance,business_city,business_country_code,business_name,business_state,business_street2,business_street,business_zip,capabilities,created_time,currency,daily_spend_limit,end_advertiser,funding_source,funding_source_details,id,is_personal,media_agency,name,offsite_pixels_tos_accepted,partner,spend_cap,timezone_id,timezone_name,timezone_offset_hours_utc,tos_accepted,users,tax_id_status
43
88
  body:
44
89
  encoding: US-ASCII
45
- string: ! '{"account_id":"10150585630710217","account_status":1,"age":590.89847222222,"amount_spent":4093,"balance":0,"business_city":"Berlin","business_country_code":"DE","business_name":"Big
46
- Mike Alright UG (haftungsbeschr\u00e4nkt)","business_state":"Berlin","business_street2":"J\u00e4gerndorfer
47
- Zeile 61","business_street":"Big Mike Alright UG (haftungsbeschr\u00e4nkt)","business_zip":"12209","capabilities":[2,6,15,11,16],"currency":"USD","daily_spend_limit":150000,"id":"act_10150585630710217","is_personal":0,"name":"","spend_cap":5000,"timezone_id":47,"timezone_name":"Europe\/Berlin","timezone_offset_hours_utc":2,"users":[{"uid":501730216,"permissions":[1,2,3,4,5,7],"role":1001}],"vat_status":3}'
90
+ string: ''
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.8.9
94
+ Accept-Encoding:
95
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
96
+ Accept:
97
+ - ! '*/*'
98
+ response:
99
+ status:
100
+ code: 200
101
+ message: !binary |-
102
+ T0s=
103
+ headers:
104
+ !binary "RmFjZWJvb2stQXBpLVZlcnNpb24=":
105
+ - !binary |-
106
+ djEuMA==
107
+ !binary "RXRhZw==":
108
+ - !binary |-
109
+ IjY5ZTQxZmViMzM1Y2FkYmUxN2Q0ZGQwZDg1YmZkZmNlNDBmZDhlNTAi
110
+ !binary "Q29udGVudC1UeXBl":
111
+ - !binary |-
112
+ YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOA==
113
+ !binary "UHJhZ21h":
114
+ - !binary |-
115
+ bm8tY2FjaGU=
116
+ !binary "QWNjZXNzLUNvbnRyb2wtQWxsb3ctT3JpZ2lu":
117
+ - !binary |-
118
+ Kg==
119
+ !binary "WC1GYi1SZXY=":
120
+ - !binary |-
121
+ MTUzNDg4NA==
122
+ !binary "Q2FjaGUtQ29udHJvbA==":
123
+ - !binary |-
124
+ cHJpdmF0ZSwgbm8tY2FjaGUsIG5vLXN0b3JlLCBtdXN0LXJldmFsaWRhdGU=
125
+ !binary "RXhwaXJlcw==":
126
+ - !binary |-
127
+ U2F0LCAwMSBKYW4gMjAwMCAwMDowMDowMCBHTVQ=
128
+ !binary "Q29udGVudC1FbmNvZGluZw==":
129
+ - !binary |-
130
+ Z3ppcA==
131
+ !binary "WC1GYi1EZWJ1Zw==":
132
+ - !binary |-
133
+ b2IyZnY1VlhIQnFIcWc3QTRLWXN5L3J4TkIya1k5YXFPNFR0OVZPdEU2Z3N2
134
+ N0p0clYzQXIraEhKYzRKOFE3Q3h3SWxEdDI0UjNDU0U5U0NnQVRNWHc9PQ==
135
+ !binary "RGF0ZQ==":
136
+ - !binary |-
137
+ V2VkLCAxNyBEZWMgMjAxNCAxMzoyMjowNyBHTVQ=
138
+ !binary "Q29ubmVjdGlvbg==":
139
+ - !binary |-
140
+ a2VlcC1hbGl2ZQ==
141
+ !binary "Q29udGVudC1MZW5ndGg=":
142
+ - !binary |-
143
+ Nzky
144
+ body:
145
+ encoding: ASCII-8BIT
146
+ string: !binary |-
147
+ H4sIAAAAAAAAA6VUwW6bQBD9FYtTq5J0wRAc37DZEGobEGCnaROtNrC2V8GA
148
+ 2EWKE+XfO4udyG0q9dATaObNzOMxb140mud1V0nCC22sGciwkT2yL4bIMZBp
149
+ OJr+DhCSyk5oYwNCGwZPZBvno8uRM7Ic0zQhujvgGlZJbWwjhHTtgZa0ygGt
150
+ 3jvBKyYEybncw7AJa0teaacJ1aDdw7OAEs3Dp8mK7lRwwjeDBX9kA7ds+WYr
151
+ B0t/8GlL17KrNuKBiXzb3nUIMat6lJ9P6xX/vsGHsUK2jEkTct8OpRvWVkXd
152
+ rlk7+MF4yQYXxkf8/3B55o1S2zTRJYRz2tAHXnLJGej7U4sTvAiWC8iE+IZM
153
+ 3UXsBn5I0ixZTrNlolRZRJNgjonrrXCSBSlOSOCRZTyPXA+y8yiaufNg1gPc
154
+ cIo9Mo3Cq8CHXJxEiZtBZLL0fJxBJLq6SoMMKwh0S4MoJNeBf00mger1NimO
155
+ SYJx6Ls+XuAwg85pT3AWEQ+nsyyKgWm4ctMeesie1K4CD0fHMODIMsUkWACZ
156
+ FVDxcQTha1W7coO5O4Gi2L3t5yxwdh39Vnbsir9nOAndOSB9TLLbWOnyTwy5
157
+ ihIyj+MTbDT3gFifVWN6Gh5JcUYyNwGJglDp9oY+fAiwSoJpSiYJdmdedBNq
158
+ 9/AfWwYrVhDJ+001kWGcIevMtDMTjU1jbDlfkImQ+uNd27IqVy5YpkrlgvJy
159
+ 31unICXfcdguQzkIbLPuqoJXGyLqrlVO0obOCFnm0LAvLNt0LO1PCCmYhHaw
160
+ Si9a7+qPBQUXTUn3apOhDiAx3ce0HBy9DkvMyrJWu2uhzX63ZW1Nm+Y8r3dq
161
+ jeW+Uf4fvuqH/jSX5G+XgwvSsFbUFS37A3B0MGTq9VpwyUjDn1gpiKwFgdGs
162
+ AfW08ZqWgunaQQzwxtstUbI+1xXrT5XlnASOjXHX1g27+/ru8HeAmsck2YI+
163
+ gnQy769YJ4CcEqmgkoLvjmrZyHCG8AUX0ADo77gQvK6UMQ3d1Ie6pdu6A3+7
164
+ rcv+CiLj9R6UkPQJiL1fyeHrL5WJX+JbBQAA
48
165
  http_version:
49
- recorded_at: Thu, 12 Sep 2013 13:21:40 GMT
166
+ recorded_at: Wed, 17 Dec 2014 13:22:08 GMT
50
167
  recorded_with: VCR 2.3.0
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/6005950787751?access_token=CAAEvJ5vzhl8BAH8aCPOx0Ft9uNB147TF8weJ8hK0g7YVDRWU4eEih7tEKdJgmfk0vABZClZACJbEzyhSMbiShL6RpsfkZASfX1C9nv1AlFvjJajflqkyYZAlpE2edT0FJHjdh4NFg0ZCt0sBgq0kZABtKsjuU18aMURLE7rjKHR4X8NkXBUafg1T4uZARRNqboZD&fields=account_id,campaign_status,created_time,daily_imps,end_time,id,lifetime_budget,name,start_time,updated_time
5
+ uri: https://graph.facebook.com/6021496142951?access_token=CAAEvJ5vzhl8BANgaZCvjMZCRsIbNZCSPswoDM0MTx8g30ojs53HUp43aVBVdqHnu9kIFytWIR5oRfp1Sy8DZBtJ9p5Rw2kY93ZAu6EwzHqZCrjmeBxXBWWlMCty1Bg4zKc3abdbjgoX4fWP4NWCEyWZCFJBKXWR0WV3ZC63bSqw7ojzYJm4teOarRc1GaesGIlIKlZB6s7EwZA1qUZCCKsdZCSsq%0A&fields=id,account_id,objective,name,adgroups,campaign_group_status,buying_type
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.8.7
11
+ - Faraday v0.8.9
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -18,31 +18,80 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
+ Facebook-Api-Version:
22
+ - v1.0
23
+ Etag:
24
+ - ! '"55cae945ccdefc5bf670f4608a5f0e8a07da3ca5"'
25
+ Content-Type:
26
+ - application/json; charset=UTF-8
27
+ Pragma:
28
+ - no-cache
21
29
  Access-Control-Allow-Origin:
22
30
  - ! '*'
31
+ X-Fb-Rev:
32
+ - '1534884'
23
33
  Cache-Control:
24
34
  - private, no-cache, no-store, must-revalidate
25
- Content-Type:
26
- - application/json; charset=UTF-8
27
- Etag:
28
- - ! '"e86bfdbd29a6618779f20e958e1dfe705bb806de"'
29
35
  Expires:
30
36
  - Sat, 01 Jan 2000 00:00:00 GMT
37
+ X-Fb-Debug:
38
+ - TDmzWPYxzb7kY+T65g0Yuj8tnEqPT6SMSVC2qFAxRCOPtIxJtfhAgJdP5QABBj1Aem1IpCLvwdEt1u6EeRMPrg==
39
+ Date:
40
+ - Wed, 17 Dec 2014 12:36:36 GMT
41
+ Connection:
42
+ - keep-alive
43
+ Content-Length:
44
+ - '149'
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"id":"6021496142951","account_id":"10150585630710217","objective":"NONE","name":"bloody","campaign_group_status":"ARCHIVED","buying_type":"AUCTION"}'
48
+ http_version:
49
+ recorded_at: Wed, 17 Dec 2014 12:36:36 GMT
50
+ - request:
51
+ method: get
52
+ uri: https://graph.facebook.com/6021496142951?access_token=CAAEvJ5vzhl8BAICOwypV5nYnYWXhBq1eskHA7rKyrz9fXcAvKRXDWVZAaG7FpQ21qTXeCtGZCR7iu1dtZCqZCZBZCQbefKrMOnZAibDZAiQKiX0s22PgtKuCoQK4LDVimREnqkGdoLMyB4zgT3A6ZAU7pn6wc2mTzZBWVbkr71bZBJKjhyeb4V58TkMsUbN9SQer3ZCRRtWTxqNFTUwHuv51RoVsI7LNw0mCr5gZD%0A&fields=id,account_id,objective,name,adgroups,campaign_group_status,buying_type
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ User-Agent:
58
+ - Faraday v0.8.9
59
+ Accept-Encoding:
60
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
+ Accept:
62
+ - ! '*/*'
63
+ response:
64
+ status:
65
+ code: 200
66
+ message: OK
67
+ headers:
68
+ Facebook-Api-Version:
69
+ - v1.0
70
+ Etag:
71
+ - ! '"55cae945ccdefc5bf670f4608a5f0e8a07da3ca5"'
72
+ Content-Type:
73
+ - application/json; charset=UTF-8
31
74
  Pragma:
32
75
  - no-cache
76
+ Access-Control-Allow-Origin:
77
+ - ! '*'
33
78
  X-Fb-Rev:
34
- - '934677'
79
+ - '1534884'
80
+ Cache-Control:
81
+ - private, no-cache, no-store, must-revalidate
82
+ Expires:
83
+ - Sat, 01 Jan 2000 00:00:00 GMT
35
84
  X-Fb-Debug:
36
- - i6CJnwde2dK30oFKSKB+yrtbjQtBwOx7j7wbo7jQdwQ=
85
+ - V86//b5y3DAluaqXAobUriiP/KE10U4Nf0XSwmy5Hwx3EgiB0lyYvZUm43VbNdkJKJfVxXZVnGG7piKEw6WRRg==
37
86
  Date:
38
- - Thu, 12 Sep 2013 13:21:40 GMT
87
+ - Wed, 17 Dec 2014 13:22:06 GMT
39
88
  Connection:
40
89
  - keep-alive
41
90
  Content-Length:
42
- - '230'
91
+ - '149'
43
92
  body:
44
93
  encoding: US-ASCII
45
- string: ! '{"account_id":"10150585630710217","campaign_status":3,"created_time":"2012-08-21T16:04:13+0200","daily_imps":0,"id":"6005950787751","name":"bloody","start_time":"2012-08-21T16:04:13+0200","updated_time":"2013-03-25T12:40:29+0100"}'
94
+ string: ! '{"id":"6021496142951","account_id":"10150585630710217","objective":"NONE","name":"bloody","campaign_group_status":"ARCHIVED","buying_type":"AUCTION"}'
46
95
  http_version:
47
- recorded_at: Thu, 12 Sep 2013 13:21:40 GMT
96
+ recorded_at: Wed, 17 Dec 2014 13:22:06 GMT
48
97
  recorded_with: VCR 2.3.0
@@ -2,13 +2,13 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/6010889111951?access_token=CAAEvJ5vzhl8BAH8aCPOx0Ft9uNB147TF8weJ8hK0g7YVDRWU4eEih7tEKdJgmfk0vABZClZACJbEzyhSMbiShL6RpsfkZASfX1C9nv1AlFvjJajflqkyYZAlpE2edT0FJHjdh4NFg0ZCt0sBgq0kZABtKsjuU18aMURLE7rjKHR4X8NkXBUafg1T4uZARRNqboZD&fields=account_id,adgroup_status,bid_info,bid_type,campaign_id,conversion_specs,created_time,creative_ids,id,disapprove_reason_descriptions,last_updated_by_app_id,name,targeting,tracking_specs,updated_time,view_tags
5
+ uri: https://graph.facebook.com/6010889111951?access_token=CAAEvJ5vzhl8BANgaZCvjMZCRsIbNZCSPswoDM0MTx8g30ojs53HUp43aVBVdqHnu9kIFytWIR5oRfp1Sy8DZBtJ9p5Rw2kY93ZAu6EwzHqZCrjmeBxXBWWlMCty1Bg4zKc3abdbjgoX4fWP4NWCEyWZCFJBKXWR0WV3ZC63bSqw7ojzYJm4teOarRc1GaesGIlIKlZB6s7EwZA1qUZCCKsdZCSsq%0A&fields=account_id,adgroup_status,bid_type,bid_info,conversion_specs,campaign_id,campaign_group_id,conversion_specs,created_time,creative_ids,failed_delivery_checks,name,targeting,tracking_specs,updated_time,view_tags
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.8.7
11
+ - Faraday v0.8.9
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -18,31 +18,84 @@ http_interactions:
18
18
  code: 400
19
19
  message: Bad Request
20
20
  headers:
21
+ Www-Authenticate:
22
+ - OAuth "Facebook Platform" "invalid_request" "(#100) Tried accessing nonexisting
23
+ field (adgroup_status) on node type (AdCampaign)"
24
+ Facebook-Api-Version:
25
+ - v1.0
26
+ Content-Type:
27
+ - application/json; charset=UTF-8
28
+ Pragma:
29
+ - no-cache
21
30
  Access-Control-Allow-Origin:
22
31
  - ! '*'
32
+ X-Fb-Rev:
33
+ - '1534884'
23
34
  Cache-Control:
24
35
  - no-store
25
- Content-Type:
26
- - application/json; charset=UTF-8
27
36
  Expires:
28
37
  - Sat, 01 Jan 2000 00:00:00 GMT
38
+ X-Fb-Debug:
39
+ - hrNs+NUgfjltB+Mcigsj4m9nyfgFWa18yMJTzHaHxr0Q8LIamdF9T8BUNk1WiOwPEjirHLwVTAZQ574vvaKhOQ==
40
+ Date:
41
+ - Wed, 17 Dec 2014 12:36:36 GMT
42
+ Connection:
43
+ - keep-alive
44
+ Content-Length:
45
+ - '142'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"error":{"message":"(#100) Tried accessing nonexisting field (adgroup_status)
49
+ on node type (AdCampaign)","type":"OAuthException","code":100}}'
50
+ http_version:
51
+ recorded_at: Wed, 17 Dec 2014 12:36:36 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://graph.facebook.com/6010889111951?access_token=CAAEvJ5vzhl8BAICOwypV5nYnYWXhBq1eskHA7rKyrz9fXcAvKRXDWVZAaG7FpQ21qTXeCtGZCR7iu1dtZCqZCZBZCQbefKrMOnZAibDZAiQKiX0s22PgtKuCoQK4LDVimREnqkGdoLMyB4zgT3A6ZAU7pn6wc2mTzZBWVbkr71bZBJKjhyeb4V58TkMsUbN9SQer3ZCRRtWTxqNFTUwHuv51RoVsI7LNw0mCr5gZD%0A&fields=id,account_id,adgroup_status,bid_type,bid_info,conversion_specs,campaign_id,campaign_group_id,conversion_specs,created_time,creative_ids,failed_delivery_checks,name,targeting,tracking_specs,updated_time,view_tags
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.8.9
61
+ Accept-Encoding:
62
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
63
+ Accept:
64
+ - ! '*/*'
65
+ response:
66
+ status:
67
+ code: 400
68
+ message: Bad Request
69
+ headers:
70
+ Www-Authenticate:
71
+ - OAuth "Facebook Platform" "invalid_request" "(#100) Tried accessing nonexisting
72
+ field (adgroup_status) on node type (AdCampaign)"
73
+ Facebook-Api-Version:
74
+ - v1.0
75
+ Content-Type:
76
+ - application/json; charset=UTF-8
29
77
  Pragma:
30
78
  - no-cache
31
- Www-Authenticate:
32
- - ! 'OAuth "Facebook Platform" "invalid_request" "(#100) Unknown fields: adgroup_status,bid_info,bid_type,conversion_specs,creative_ids,disapprove_reason_descriptions,last_updated_by_app_id,targeting,tracking_specs,view_tags."'
79
+ Access-Control-Allow-Origin:
80
+ - ! '*'
33
81
  X-Fb-Rev:
34
- - '934677'
82
+ - '1534884'
83
+ Cache-Control:
84
+ - no-store
85
+ Expires:
86
+ - Sat, 01 Jan 2000 00:00:00 GMT
35
87
  X-Fb-Debug:
36
- - Gks1Vwa18J2bq9/Zxb9ya6ywWnVPynwEDSmFjSxKc9k=
88
+ - ZmwXEClzqPL6Geuc4uXD1l1e16OiLJcKYrPfkA7s9KAyECHHfiK/FFwDDnPpICTbziM09AAZxF0vIsYToh98fA==
37
89
  Date:
38
- - Thu, 12 Sep 2013 13:21:40 GMT
90
+ - Wed, 17 Dec 2014 13:22:08 GMT
39
91
  Connection:
40
92
  - keep-alive
41
93
  Content-Length:
42
- - '234'
94
+ - '142'
43
95
  body:
44
96
  encoding: US-ASCII
45
- string: ! '{"error":{"message":"(#100) Unknown fields: adgroup_status,bid_info,bid_type,conversion_specs,creative_ids,disapprove_reason_descriptions,last_updated_by_app_id,targeting,tracking_specs,view_tags.","type":"OAuthException","code":100}}'
97
+ string: ! '{"error":{"message":"(#100) Tried accessing nonexisting field (adgroup_status)
98
+ on node type (AdCampaign)","type":"OAuthException","code":100}}'
46
99
  http_version:
47
- recorded_at: Thu, 12 Sep 2013 13:21:41 GMT
100
+ recorded_at: Wed, 17 Dec 2014 13:22:08 GMT
48
101
  recorded_with: VCR 2.3.0
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.8.7
11
+ - Faraday v0.8.9
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -18,8 +18,10 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
+ Facebook-Api-Version:
22
+ - v1.0
21
23
  Etag:
22
- - ! '"8b5fcea570986b5e25aff7226b80215ebf71cf56"'
24
+ - ! '"b0e223182b3f454da05345a3873cb31706b7cb78"'
23
25
  Content-Type:
24
26
  - application/json; charset=UTF-8
25
27
  Pragma:
@@ -27,28 +29,28 @@ http_interactions:
27
29
  Access-Control-Allow-Origin:
28
30
  - ! '*'
29
31
  X-Fb-Rev:
30
- - '1216101'
32
+ - '1534884'
31
33
  Cache-Control:
32
34
  - private, no-cache, no-store, must-revalidate
33
35
  Expires:
34
36
  - Sat, 01 Jan 2000 00:00:00 GMT
35
37
  X-Fb-Debug:
36
- - oBEMRG6MgL42DEtthxp3LNt+Gzgr2GbJckt8uA8N/q8=
38
+ - c5TS3GwP/Tzb2f929NEOK3kHE4cmKjRmmgdE02aqHGw7A/vmcgKszYotYyrb6eINCCOaQi9X4wYN+GOy3PRDnw==
37
39
  Date:
38
- - Tue, 22 Apr 2014 16:22:30 GMT
40
+ - Wed, 17 Dec 2014 13:24:51 GMT
39
41
  Connection:
40
42
  - keep-alive
41
43
  Content-Length:
42
- - '854'
44
+ - '850'
43
45
  body:
44
46
  encoding: US-ASCII
45
- string: ! '{"data":[{"name":"The Walt Disney Company","id":6003270522085,"audience_size":129354141,"path":[],"description":null},{"name":"Disney
46
- Channel","id":6003327130854,"audience_size":45965936,"path":[],"description":null},{"name":"Walt
47
- Disney","id":6003284678611,"audience_size":38133064,"path":[],"description":null},{"name":"Disneyland","id":6003274193708,"audience_size":31257896,"path":[],"description":null},{"name":"Walt
48
- Disney Parks and Resorts","id":6003318701218,"audience_size":26448385,"path":[],"description":null},{"name":"List
49
- of Disney Channel Original Movies","id":6003220883649,"audience_size":38392980,"path":[],"description":null},{"name":"Disney
50
- XD","id":6003540152503,"audience_size":16841504,"path":[],"description":null},{"name":"Walt
51
- Disney Animation Studios","id":6003375444677,"audience_size":17506594,"path":[],"description":null}]}'
47
+ string: ! '{"data":[{"name":"The Walt Disney Company","id":6003270522085,"audience_size":144930320,"path":[],"description":null},{"name":"Walt
48
+ Disney Pictures","id":6003050377616,"audience_size":75083700,"path":[],"description":null},{"name":"Walt
49
+ Disney","id":6003284678611,"audience_size":66833180,"path":[],"description":null},{"name":"Walt
50
+ Disney Parks and Resorts","id":6003318701218,"audience_size":53996790,"path":[],"description":null},{"name":"Disney.com","id":6003413951089,"audience_size":43788560,"path":[],"description":null},{"name":"Disney
51
+ Interactive","id":6003311026888,"audience_size":42316480,"path":[],"description":null},{"name":"The
52
+ Walt Disney Studios (division)","id":6007022518262,"audience_size":46006250,"path":[],"description":null},{"name":"Disney
53
+ Channel","id":6003327130854,"audience_size":56498220,"path":[],"description":null}]}'
52
54
  http_version:
53
- recorded_at: Tue, 22 Apr 2014 16:22:31 GMT
55
+ recorded_at: Wed, 17 Dec 2014 13:24:51 GMT
54
56
  recorded_with: VCR 2.3.0