zuck 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +13 -5
  2. data/CHANGELOG.markdown +9 -0
  3. data/README.markdown +7 -1
  4. data/VERSION +1 -1
  5. data/lib/zuck/facebook/ad_creative.rb +0 -3
  6. data/lib/zuck/facebook/ad_group.rb +7 -7
  7. data/lib/zuck/facebook/targeting_spec.rb +0 -1
  8. data/lib/zuck.rb +6 -0
  9. data/spec/fixtures/a_single_account.yml +31 -111
  10. data/spec/fixtures/a_single_campaign.yml +11 -57
  11. data/spec/fixtures/a_single_group.yml +13 -62
  12. data/spec/fixtures/ad_interest_search_disney.yml +19 -19
  13. data/spec/fixtures/ad_interest_search_moviepilot.yml +15 -18
  14. data/spec/fixtures/ad_interest_search_nonexistant.yml +11 -11
  15. data/spec/fixtures/create_a_creative.yml +48 -0
  16. data/spec/fixtures/create_ad_campaign.yml +44 -226
  17. data/spec/fixtures/create_ad_group.yml +13 -155
  18. data/spec/fixtures/create_ad_set.yml +11 -57
  19. data/spec/fixtures/delete_ad_group.yml +10 -55
  20. data/spec/fixtures/delete_ad_set.yml +48 -0
  21. data/spec/fixtures/delete_campaign.yml +93 -0
  22. data/spec/fixtures/delete_creative.yml +48 -0
  23. data/spec/fixtures/find_a_single_group_and_update_it.yml +84 -110
  24. data/spec/fixtures/list_of_ad_accounts.yml +10 -57
  25. data/spec/fixtures/list_of_ad_campaigns.yml +10 -57
  26. data/spec/fixtures/list_of_ad_creatives.yml +9 -56
  27. data/spec/fixtures/list_of_ad_groups.yml +10 -57
  28. data/spec/fixtures/list_of_all_ad_creatives_of_account.yml +10 -57
  29. data/spec/fixtures/reach_for_invalid_interest.yml +28 -31
  30. data/spec/fixtures/reach_for_valid_keywords.yml +13 -13
  31. data/spec/fixtures/reach_for_valid_keywords_male_young.yml +13 -13
  32. data/spec/lib/zuck/facebook/ad_interest_spec.rb +1 -1
  33. data/spec/lib/zuck/facebook/targeting_spec_spec.rb +3 -3
  34. data/spec/lib/zuck_spec.rb +125 -86
  35. data/spec/spec_helper.rb +14 -0
  36. data/test_access_token +1 -1
  37. data/zuck.gemspec +7 -3
  38. metadata +49 -45
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/6021499361751/adgroups?access_token=CAAEvJ5vzhl8BANgaZCvjMZCRsIbNZCSPswoDM0MTx8g30ojs53HUp43aVBVdqHnu9kIFytWIR5oRfp1Sy8DZBtJ9p5Rw2kY93ZAu6EwzHqZCrjmeBxXBWWlMCty1Bg4zKc3abdbjgoX4fWP4NWCEyWZCFJBKXWR0WV3ZC63bSqw7ojzYJm4teOarRc1GaesGIlIKlZB6s7EwZA1qUZCCKsdZCSsq%0A&fields=
5
+ uri: https://graph.facebook.com/v2.2/6024300271066/adgroups?access_token=FAKEACCESSTOKEN&fields=
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -18,80 +18,33 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- Facebook-Api-Version:
22
- - v1.0
23
- Etag:
24
- - ! '"8633e0598e35ea3081cddeeda7005e1ebd3d18bb"'
25
21
  Content-Type:
26
22
  - application/json; charset=UTF-8
27
- Pragma:
28
- - no-cache
29
23
  Access-Control-Allow-Origin:
30
24
  - ! '*'
31
25
  X-Fb-Rev:
32
- - '1534884'
33
- Cache-Control:
34
- - private, no-cache, no-store, must-revalidate
35
- Expires:
36
- - Sat, 01 Jan 2000 00:00:00 GMT
37
- X-Fb-Debug:
38
- - vd7dNLE7GDVFEb3JhmK/1+WPfh4vtmYaqLnUXO2rSg0elzVAVmjvql5l5lEJ3H821bCNFiPLGLPKj/IGP7q5+A==
39
- Date:
40
- - Wed, 17 Dec 2014 12:36:35 GMT
41
- Connection:
42
- - keep-alive
43
- Content-Length:
44
- - '165'
45
- body:
46
- encoding: US-ASCII
47
- string: ! '{"data":[{"id":"6021525982751"},{"id":"6021525876351"},{"id":"6021525861551"}],"paging":{"cursors":{"before":"NjAyMTUyNTk4Mjc1MQ==","after":"NjAyMTUyNTg2MTU1MQ=="}}}'
48
- http_version:
49
- recorded_at: Wed, 17 Dec 2014 12:36:35 GMT
50
- - request:
51
- method: get
52
- uri: https://graph.facebook.com/6021499361751/adgroups?access_token=CAAEvJ5vzhl8BAICOwypV5nYnYWXhBq1eskHA7rKyrz9fXcAvKRXDWVZAaG7FpQ21qTXeCtGZCR7iu1dtZCqZCZBZCQbefKrMOnZAibDZAiQKiX0s22PgtKuCoQK4LDVimREnqkGdoLMyB4zgT3A6ZAU7pn6wc2mTzZBWVbkr71bZBJKjhyeb4V58TkMsUbN9SQer3ZCRRtWTxqNFTUwHuv51RoVsI7LNw0mCr5gZD%0A&fields=
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
26
+ - '1690131'
70
27
  Etag:
71
- - ! '"785092532354ba5f8d62e00808e4123f1bcde0c6"'
72
- Content-Type:
73
- - application/json; charset=UTF-8
28
+ - ! '"993fdf09a2e1595d6c573fe8d59352a2a6ba7a08"'
74
29
  Pragma:
75
30
  - no-cache
76
- Access-Control-Allow-Origin:
77
- - ! '*'
78
- X-Fb-Rev:
79
- - '1534884'
80
31
  Cache-Control:
81
32
  - private, no-cache, no-store, must-revalidate
33
+ Facebook-Api-Version:
34
+ - v2.2
82
35
  Expires:
83
36
  - Sat, 01 Jan 2000 00:00:00 GMT
84
37
  X-Fb-Debug:
85
- - ubTtMNag5Ex7ENBS+TzTz6aSJNVine3VsXQj70udBKldPn80xOwqOKSyg/CfTGJ16qNfTNN7arHrDGuY1Dgj1w==
38
+ - t0z8hIgbn2xtkuyMmTQfd65Ij5mCrFwhVZq4OcK3iogQEV4/5v42jDROmAav8Gj7w0Mvwl3aAG32zQac//JVSw==
86
39
  Date:
87
- - Wed, 17 Dec 2014 13:22:05 GMT
40
+ - Wed, 15 Apr 2015 08:31:53 GMT
88
41
  Connection:
89
42
  - keep-alive
90
43
  Content-Length:
91
- - '188'
44
+ - '119'
92
45
  body:
93
46
  encoding: US-ASCII
94
- string: ! '{"data":[{"id":"6021526003751"},{"id":"6021525982751"},{"id":"6021525876351"},{"id":"6021525861551"}],"paging":{"cursors":{"before":"NjAyMTUyNjAwMzc1MQ==","after":"NjAyMTUyNTg2MTU1MQ=="}}}'
47
+ string: ! '{"data":[{"id":"6024300273866"}],"paging":{"cursors":{"before":"NjAyNDMwMDI3Mzg2Ng==","after":"NjAyNDMwMDI3Mzg2Ng=="}}}'
95
48
  http_version:
96
- recorded_at: Wed, 17 Dec 2014 13:22:05 GMT
49
+ recorded_at: Wed, 15 Apr 2015 08:31:55 GMT
97
50
  recorded_with: VCR 2.3.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/act_10150585630710217/adcreatives?access_token=CAAEvJ5vzhl8BANgaZCvjMZCRsIbNZCSPswoDM0MTx8g30ojs53HUp43aVBVdqHnu9kIFytWIR5oRfp1Sy8DZBtJ9p5Rw2kY93ZAu6EwzHqZCrjmeBxXBWWlMCty1Bg4zKc3abdbjgoX4fWP4NWCEyWZCFJBKXWR0WV3ZC63bSqw7ojzYJm4teOarRc1GaesGIlIKlZB6s7EwZA1qUZCCKsdZCSsq%0A&fields=
5
+ uri: https://graph.facebook.com/v2.2/act_367106653/adcreatives?access_token=FAKEACCESSTOKEN&fields=
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -18,80 +18,33 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- Facebook-Api-Version:
22
- - v1.0
23
- Etag:
24
- - ! '"097453d022fe293736d7a96bd423883d31ca8ad5"'
25
21
  Content-Type:
26
22
  - application/json; charset=UTF-8
27
- Pragma:
28
- - no-cache
29
23
  Access-Control-Allow-Origin:
30
24
  - ! '*'
31
25
  X-Fb-Rev:
32
- - '1534884'
33
- Cache-Control:
34
- - private, no-cache, no-store, must-revalidate
35
- Expires:
36
- - Sat, 01 Jan 2000 00:00:00 GMT
37
- X-Fb-Debug:
38
- - IODDyHGEfyt2DcMA7gGiPfy9Gzj0yguOO+hmjZTg1aoG8lJ7lCDzwAuOr8bYybSROEb2CxyWu/Zz/f057dGzqw==
39
- Date:
40
- - Wed, 17 Dec 2014 12:36:35 GMT
41
- Connection:
42
- - keep-alive
43
- Content-Length:
44
- - '395'
45
- body:
46
- encoding: US-ASCII
47
- string: ! '{"data":[{"id":"6021396606151"},{"id":"6013351235551"},{"id":"6013351233351"},{"id":"6011746439951"},{"id":"6010888561951"},{"id":"6010341812751"},{"id":"6010341810151"},{"id":"6005851371551"},{"id":"6004501081751"},{"id":"6004500825351"},{"id":"6004500752551"},{"id":"6004497043751"},{"id":"6004497038551"}],"paging":{"cursors":{"before":"NjAyMTM5NjYwNjE1MQ==","after":"NjAwNDQ5NzAzODU1MQ=="}}}'
48
- http_version:
49
- recorded_at: Wed, 17 Dec 2014 12:36:35 GMT
50
- - request:
51
- method: get
52
- uri: https://graph.facebook.com/act_10150585630710217/adcreatives?access_token=CAAEvJ5vzhl8BAICOwypV5nYnYWXhBq1eskHA7rKyrz9fXcAvKRXDWVZAaG7FpQ21qTXeCtGZCR7iu1dtZCqZCZBZCQbefKrMOnZAibDZAiQKiX0s22PgtKuCoQK4LDVimREnqkGdoLMyB4zgT3A6ZAU7pn6wc2mTzZBWVbkr71bZBJKjhyeb4V58TkMsUbN9SQer3ZCRRtWTxqNFTUwHuv51RoVsI7LNw0mCr5gZD%0A&fields=
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
26
+ - '1690131'
70
27
  Etag:
71
- - ! '"097453d022fe293736d7a96bd423883d31ca8ad5"'
72
- Content-Type:
73
- - application/json; charset=UTF-8
28
+ - ! '"519ca91275b41e340470774231c7ba9eed88d765"'
74
29
  Pragma:
75
30
  - no-cache
76
- Access-Control-Allow-Origin:
77
- - ! '*'
78
- X-Fb-Rev:
79
- - '1534884'
80
31
  Cache-Control:
81
32
  - private, no-cache, no-store, must-revalidate
33
+ Facebook-Api-Version:
34
+ - v2.2
82
35
  Expires:
83
36
  - Sat, 01 Jan 2000 00:00:00 GMT
84
37
  X-Fb-Debug:
85
- - wfSneHPkIqG3jcxgugJVy71nWIzGvYz1G1/SUa5T5Tg9hNQrO89TLVIa/ZFFc6cbnXYbokkDRaKHOTAlhy7mzw==
38
+ - xZV92oRWjdgT3+7afcWabLUfTdS2N59ELaMmDIjj/+qlQxKQtw+SScoQHvQKBaCr9vhKva61j8UHfqSjbFwTHg==
86
39
  Date:
87
- - Wed, 17 Dec 2014 13:22:06 GMT
40
+ - Wed, 15 Apr 2015 08:31:54 GMT
88
41
  Connection:
89
42
  - keep-alive
90
43
  Content-Length:
91
- - '395'
44
+ - '119'
92
45
  body:
93
46
  encoding: US-ASCII
94
- string: ! '{"data":[{"id":"6021396606151"},{"id":"6013351235551"},{"id":"6013351233351"},{"id":"6011746439951"},{"id":"6010888561951"},{"id":"6010341812751"},{"id":"6010341810151"},{"id":"6005851371551"},{"id":"6004501081751"},{"id":"6004500825351"},{"id":"6004500752551"},{"id":"6004497043751"},{"id":"6004497038551"}],"paging":{"cursors":{"before":"NjAyMTM5NjYwNjE1MQ==","after":"NjAwNDQ5NzAzODU1MQ=="}}}'
47
+ string: ! '{"data":[{"id":"6024299683866"}],"paging":{"cursors":{"before":"NjAyNDI5OTY4Mzg2Ng==","after":"NjAyNDI5OTY4Mzg2Ng=="}}}'
95
48
  http_version:
96
- recorded_at: Wed, 17 Dec 2014 13:22:06 GMT
49
+ recorded_at: Wed, 15 Apr 2015 08:31:56 GMT
97
50
  recorded_with: VCR 2.3.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/search?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&q=Eminem&type=adinterest
5
+ uri: https://graph.facebook.com/v2.2/search?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&q=Eminem&type=adinterest
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -18,45 +18,42 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- Facebook-Api-Version:
22
- - v1.0
23
- Etag:
24
- - ! '"038ae6611c2b53eb4b5ed92233d5c571c499c852"'
25
21
  Content-Type:
26
22
  - application/json; charset=UTF-8
27
- Pragma:
28
- - no-cache
29
23
  Access-Control-Allow-Origin:
30
24
  - ! '*'
31
25
  X-Fb-Rev:
32
- - '1534884'
26
+ - '1690131'
27
+ Etag:
28
+ - ! '"8a79bf5673dcfc21554b3bdb9fca30b52f467a2a"'
29
+ Pragma:
30
+ - no-cache
33
31
  Cache-Control:
34
32
  - private, no-cache, no-store, must-revalidate
33
+ Facebook-Api-Version:
34
+ - v2.2
35
35
  Expires:
36
36
  - Sat, 01 Jan 2000 00:00:00 GMT
37
37
  X-Fb-Debug:
38
- - Xx4hmJYbZbA8bbIW6ZUL908Kqm/xhnf9OyKPefsMFeuqPg1VyWP5KzlKaEPcLMc6BFyJ4Y4aHTwD2Hs+egBJ7Q==
38
+ - lCyUeevTwFibTPZqstUHyZXhmamylGB/PQ67RhWOVt4rUIbiwWsqeOuVfbCl9dOfAuBfX9T2B4Kr4sHMuTyKQQ==
39
39
  Date:
40
- - Wed, 17 Dec 2014 13:24:52 GMT
40
+ - Wed, 15 Apr 2015 08:31:45 GMT
41
41
  Connection:
42
42
  - keep-alive
43
43
  Content-Length:
44
- - '805'
44
+ - '798'
45
45
  body:
46
46
  encoding: US-ASCII
47
- string: ! '{"data":[{"name":"Eminem","id":6003135347608,"audience_size":108895170,"path":[],"description":null},{"name":"The
48
- Eminem Show","id":6003250214311,"audience_size":77608860,"path":[],"description":null},{"name":"Recovery
49
- (Eminem album)","id":6003489780564,"audience_size":78112930,"path":[],"description":null},{"name":"eminem
50
- fans","id":6004596403706,"audience_size":1249510,"path":[],"description":null},{"name":"eminem
51
- lovers","id":6003291289702,"audience_size":1103070,"path":[],"description":null},{"name":"eminem
52
- world","id":6003455354537,"audience_size":693520,"path":[],"description":null},{"name":"eminem
53
- forever blog","id":6017042219356,"audience_size":463490,"path":[],"description":null},{"name":"eminem
54
- marshall mathers","id":6003009763850,"audience_size":331000,"path":[],"description":null}]}'
47
+ string: ! '{"data":[{"id":"6003135347608","name":"Eminem","audience_size":119611820,"path":[],"description":null},{"id":"6003250214311","name":"The
48
+ Eminem Show","audience_size":77447340,"path":[],"description":null},{"id":"6003489780564","name":"Recovery
49
+ (Eminem album)","audience_size":77945310,"path":[],"description":null},{"id":"6003902302066","name":"Feud","audience_size":3491280,"path":[],"description":null},{"id":"6003170652434","name":"eminem","audience_size":78202590,"path":[],"description":null},{"id":"6003128077124","name":"Love
50
+ the Way You Lie","audience_size":1633850,"path":[],"description":null},{"id":"6004703849336","name":"Hip
51
+ hop feud","audience_size":1531490,"path":[],"description":null},{"id":"6004151469695","name":"em\u0131nem","audience_size":51952,"path":[],"description":null}]}'
55
52
  http_version:
56
- recorded_at: Wed, 17 Dec 2014 13:24:52 GMT
53
+ recorded_at: Wed, 15 Apr 2015 08:31:47 GMT
57
54
  - request:
58
55
  method: get
59
- uri: https://graph.facebook.com/search?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&q=invalidsssssssssssssss&type=adinterest
56
+ uri: https://graph.facebook.com/v2.2/search?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&q=invalidsssssssssssssss&type=adinterest
60
57
  body:
61
58
  encoding: US-ASCII
62
59
  string: ''
@@ -72,26 +69,26 @@ http_interactions:
72
69
  code: 200
73
70
  message: OK
74
71
  headers:
75
- Facebook-Api-Version:
76
- - v1.0
77
- Etag:
78
- - ! '"1050253aec7b29caff644806927dabfa81406eee"'
79
72
  Content-Type:
80
73
  - application/json; charset=UTF-8
81
- Pragma:
82
- - no-cache
83
74
  Access-Control-Allow-Origin:
84
75
  - ! '*'
85
76
  X-Fb-Rev:
86
- - '1534884'
77
+ - '1690131'
78
+ Etag:
79
+ - ! '"1050253aec7b29caff644806927dabfa81406eee"'
80
+ Pragma:
81
+ - no-cache
87
82
  Cache-Control:
88
83
  - private, no-cache, no-store, must-revalidate
84
+ Facebook-Api-Version:
85
+ - v2.2
89
86
  Expires:
90
87
  - Sat, 01 Jan 2000 00:00:00 GMT
91
88
  X-Fb-Debug:
92
- - O5K0/pQRSftbJQUJZxGLcsf58NbkxSIuuEmiBp2N3w2a/thaJMEiOylfYED9tI17bZItsWBh8PKjqJqzqmclgg==
89
+ - zHtPaH8mPkg8j02BJazr0mWhLktYcUKF4cJc1hIUWLVl2HdDxCCj7zC4vRdqInEBFhBMvDoDbI1S5936dBODbA==
93
90
  Date:
94
- - Wed, 17 Dec 2014 13:24:52 GMT
91
+ - Wed, 15 Apr 2015 08:31:46 GMT
95
92
  Connection:
96
93
  - keep-alive
97
94
  Content-Length:
@@ -100,5 +97,5 @@ http_interactions:
100
97
  encoding: US-ASCII
101
98
  string: ! '{"data":[]}'
102
99
  http_version:
103
- recorded_at: Wed, 17 Dec 2014 13:24:52 GMT
100
+ recorded_at: Wed, 15 Apr 2015 08:31:48 GMT
104
101
  recorded_with: VCR 2.3.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/act_1384977038406122/reachestimate?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&targeting_spec=%7B%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D,%22interests%22:%5B%7B%22id%22:%226003135347608%22,%22name%22:%22Eminem%22%7D,%7B%22id%22:%226003504886186%22,%22name%22:%22Sting%20(musician)%22%7D%5D,%22age_min%22:13,%22countries%22:%5B%5D,%22connections%22:%5B%5D,%22broad_age%22:false%7D
5
+ uri: https://graph.facebook.com/v2.2/act_1384977038406122/reachestimate?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&targeting_spec=%7B%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D,%22interests%22:%5B%7B%22id%22:%226003135347608%22,%22name%22:%22Eminem%22%7D,%7B%22id%22:%226003504886186%22,%22name%22:%22Sting%20(musician)%22%7D%5D,%22age_min%22:13,%22countries%22:%5B%5D,%22connections%22:%5B%5D%7D
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -18,33 +18,33 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- Facebook-Api-Version:
22
- - v1.0
23
- Etag:
24
- - ! '"6091c44df86603e9fa3d02108fa4a66195cc8afc"'
25
21
  Content-Type:
26
22
  - application/json; charset=UTF-8
27
- Pragma:
28
- - no-cache
29
23
  Access-Control-Allow-Origin:
30
24
  - ! '*'
31
25
  X-Fb-Rev:
32
- - '1534884'
26
+ - '1690131'
27
+ Etag:
28
+ - ! '"c081fa992fa810ff727e2c62a3f07a337b225ad3"'
29
+ Pragma:
30
+ - no-cache
33
31
  Cache-Control:
34
32
  - private, no-cache, no-store, must-revalidate
33
+ Facebook-Api-Version:
34
+ - v2.2
35
35
  Expires:
36
36
  - Sat, 01 Jan 2000 00:00:00 GMT
37
37
  X-Fb-Debug:
38
- - UQm3XcD/KHuSX+cXCyjgiHZPvXyxjJ3dmixnCSxG/7ErgcSDcDfNv6PKJ4iFqpsdg0rdQzbZg5Y2NhT8uzGMxQ==
38
+ - 8CQmvP8bZFslRFwWkK1SNvVZ1zFDa+wff77F/Hhe7B4zPqVMNAKxxvDR3ceaWbttcFHYO5VxgTEwM7eekCoczw==
39
39
  Date:
40
- - Wed, 17 Dec 2014 13:24:53 GMT
40
+ - Wed, 15 Apr 2015 08:31:46 GMT
41
41
  Connection:
42
42
  - keep-alive
43
43
  Content-Length:
44
- - '456'
44
+ - '452'
45
45
  body:
46
46
  encoding: US-ASCII
47
- string: ! '{"users":28000000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":37,"cpa_median":69,"cpa_max":100,"cpc_min":19,"cpc_median":35,"cpc_max":50,"cpm_min":84,"cpm_median":270,"cpm_max":440}],"estimate_ready":true,"data":{"users":28000000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":37,"cpa_median":69,"cpa_max":100,"cpc_min":19,"cpc_median":35,"cpc_max":50,"cpm_min":84,"cpm_median":270,"cpm_max":440}],"estimate_ready":true}}'
47
+ string: ! '{"users":37000000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":15,"cpa_median":27,"cpa_max":37,"cpc_min":6,"cpc_median":10,"cpc_max":13,"cpm_min":45,"cpm_median":257,"cpm_max":429}],"estimate_ready":true,"data":{"users":37000000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":15,"cpa_median":27,"cpa_max":37,"cpc_min":6,"cpc_median":10,"cpc_max":13,"cpm_min":45,"cpm_median":257,"cpm_max":429}],"estimate_ready":true}}'
48
48
  http_version:
49
- recorded_at: Wed, 17 Dec 2014 13:24:53 GMT
49
+ recorded_at: Wed, 15 Apr 2015 08:31:48 GMT
50
50
  recorded_with: VCR 2.3.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/act_1384977038406122/reachestimate?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&targeting_spec=%7B%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D,%22interests%22:%5B%7B%22id%22:%226003504886186%22,%22name%22:%22Sting%20(musician)%22%7D%5D,%22age_min%22:13,%22age_max%22:24,%22genders%22:%5B2%5D,%22countries%22:%5B%5D,%22connections%22:%5B%5D,%22broad_age%22:false%7D
5
+ uri: https://graph.facebook.com/v2.2/act_1384977038406122/reachestimate?access_token=CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh&targeting_spec=%7B%22geo_locations%22:%7B%22countries%22:%5B%22US%22%5D%7D,%22interests%22:%5B%7B%22id%22:%226003504886186%22,%22name%22:%22Sting%20(musician)%22%7D%5D,%22age_min%22:13,%22age_max%22:24,%22genders%22:%5B2%5D,%22countries%22:%5B%5D,%22connections%22:%5B%5D%7D
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -18,33 +18,33 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- Facebook-Api-Version:
22
- - v1.0
23
- Etag:
24
- - ! '"3af0f7e765b8380f2a723302f594d583fde67beb"'
25
21
  Content-Type:
26
22
  - application/json; charset=UTF-8
27
- Pragma:
28
- - no-cache
29
23
  Access-Control-Allow-Origin:
30
24
  - ! '*'
31
25
  X-Fb-Rev:
32
- - '1534884'
26
+ - '1690131'
27
+ Etag:
28
+ - ! '"a73131e9a917d324772c67deb8439a6b7920b5fc"'
29
+ Pragma:
30
+ - no-cache
33
31
  Cache-Control:
34
32
  - private, no-cache, no-store, must-revalidate
33
+ Facebook-Api-Version:
34
+ - v2.2
35
35
  Expires:
36
36
  - Sat, 01 Jan 2000 00:00:00 GMT
37
37
  X-Fb-Debug:
38
- - O43UJHL/22OCfbvpGri9vMFEaOzegP5DNpgNRrrpuZyyhX54rTAXn0RVqN83GxQz0Yyu6YdxjfZBJMCY9QAqxw==
38
+ - ne/YLUTYDwlwIF07UxvtizPBcIiEPPDgGDn6RUAuvc6DP3kftUX94ZUlI5/kH5XoASCbZ16arkMLEJv0k40Psg==
39
39
  Date:
40
- - Wed, 17 Dec 2014 13:24:54 GMT
40
+ - Wed, 15 Apr 2015 08:31:47 GMT
41
41
  Connection:
42
42
  - keep-alive
43
43
  Content-Length:
44
- - '452'
44
+ - '444'
45
45
  body:
46
46
  encoding: US-ASCII
47
- string: ! '{"users":220000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":30,"cpa_median":58,"cpa_max":83,"cpc_min":15,"cpc_median":28,"cpc_max":39,"cpm_min":101,"cpm_median":270,"cpm_max":427}],"estimate_ready":true,"data":{"users":220000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":30,"cpa_median":58,"cpa_max":83,"cpc_min":15,"cpc_median":28,"cpc_max":39,"cpm_min":101,"cpm_median":270,"cpm_max":427}],"estimate_ready":true}}'
47
+ string: ! '{"users":16000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":16,"cpa_median":27,"cpa_max":36,"cpc_min":5,"cpc_median":9,"cpc_max":12,"cpm_min":26,"cpm_median":148,"cpm_max":309}],"estimate_ready":true,"data":{"users":16000,"bid_estimations":[{"unsupported":false,"location":3,"cpa_min":16,"cpa_median":27,"cpa_max":36,"cpc_min":5,"cpc_median":9,"cpc_max":12,"cpm_min":26,"cpm_median":148,"cpm_max":309}],"estimate_ready":true}}'
48
48
  http_version:
49
- recorded_at: Wed, 17 Dec 2014 13:24:54 GMT
49
+ recorded_at: Wed, 15 Apr 2015 08:31:49 GMT
50
50
  recorded_with: VCR 2.3.0
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Zuck::AdInterest do
4
- let(:graph){ Koala::Facebook::API.new('CAAEvJ5vzhl8BAPGZCZCPL4FxryEHXGxPCuCGeqe3PEWIjhIvJ00HB8PPpokFmUkemvmEUHirqdNMc7zIDLSTVnX6jTQjAgSlzcYrAYJRQ32fr6RM5ZAnKPdgFEwN5tgvswatXZAI4vu7ZBAQexRl9MU0CpwW7JDDBZAGo5XDrCKrBxkUUWJUvh')}
4
+ let(:graph){ Koala::Facebook::API.new(test_access_token)}
5
5
 
6
6
  it "finds the best interest with a #" do
7
7
  VCR.use_cassette('ad_interest_search_disney') do
@@ -51,7 +51,7 @@ describe Zuck::TargetingSpec do
51
51
  }.to_not raise_error
52
52
  end
53
53
 
54
- it "accepts single keywrod" do
54
+ it "accepts single keyword" do
55
55
  expect{
56
56
  Zuck::TargetingSpec.new(graph, ad_account, geo_locations: {countries: ['US']}, interest: 'foo')
57
57
  }.to_not raise_error
@@ -98,7 +98,7 @@ describe Zuck::TargetingSpec do
98
98
  spec = {geo_locations: {countries: ['us']}, interests: [{id: '6003135347608', name: 'Eminem'}, {id: '6003504886186', name: 'Sting (musician)'}] }
99
99
  ts = Zuck::TargetingSpec.new(graph, ad_account, spec)
100
100
  reach = ts.fetch_reach
101
- reach[:users].should == 28_00_0000
101
+ reach[:users].should == 37_00_0000
102
102
  end
103
103
  end
104
104
 
@@ -107,7 +107,7 @@ describe Zuck::TargetingSpec do
107
107
  spec = {geo_locations: {countries: ['us']}, interests: [{id: '6003504886186', name: 'Sting (musician)'}], gender: :female, age_class: :young }
108
108
  ts = Zuck::TargetingSpec.new(graph, ad_account, spec)
109
109
  reach = ts.fetch_reach
110
- reach[:users].should == 220_000
110
+ reach[:users].should == 16_000
111
111
  end
112
112
  end
113
113