fb_graph-mock 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +19 -0
- data/VERSION +1 -0
- data/fb_graph-mock.gemspec +18 -0
- data/lib/fb_graph/mock.rb +112 -0
- data/mock_json/.gitkeep +0 -0
- data/mock_json/ad_accounts/ad_campaign_stats/test_ad_campaign_stats.json +42 -0
- data/mock_json/ad_accounts/ad_campaigns/post_with_redownload.json +19 -0
- data/mock_json/ad_accounts/ad_campaigns/post_with_valid_access_token.json +3 -0
- data/mock_json/ad_accounts/ad_connection_objects/test_connection_objects.json +34 -0
- data/mock_json/ad_accounts/ad_group_stats/test_ad_group_stats.json +62 -0
- data/mock_json/ad_accounts/ad_groups/post_with_redownload.json +51 -0
- data/mock_json/ad_accounts/ad_groups/post_with_valid_access_token.json +1 -0
- data/mock_json/ad_accounts/broad_targeting_categories/test_bct.json +19 -0
- data/mock_json/ad_accounts/previews/test_ad_previews.json +7 -0
- data/mock_json/ad_accounts/reach_estimates/test_reach_estimates.json +31 -0
- data/mock_json/ad_accounts/test_ad_account.json +37 -0
- data/mock_json/ad_campaigns/ad_groups/22334455_ad_groups.json +67 -0
- data/mock_json/ad_campaigns/test_ad_campaign.json +11 -0
- data/mock_json/ad_campaigns/test_ad_campaign_update_with_redownload.json +19 -0
- data/mock_json/ad_creatives/test_ad_creative.json +16 -0
- data/mock_json/ad_groups/ad_creatives/22334455_ad_creatives.json +18 -0
- data/mock_json/ad_groups/test_ad_group.json +14 -0
- data/mock_json/ad_groups/test_ad_group_update_with_redownload.json +51 -0
- data/mock_json/ad_keyword_suggestions/buffy_suggestions.json +40 -0
- data/mock_json/ad_keyword_valids/tige_search.json +14 -0
- data/mock_json/ad_keywords/buffy_search.json +42 -0
- data/mock_json/albums/photos/matake_private.json +97 -0
- data/mock_json/albums/photos/post_with_valid_access_token.json +1 -0
- data/mock_json/albums/picture/success.json +5 -0
- data/mock_json/app_token_response.json +1 -0
- data/mock_json/applications/accounts/private.json +9 -0
- data/mock_json/applications/achievements/sample.json +24 -0
- data/mock_json/applications/banned/banned_user.json +9 -0
- data/mock_json/applications/banned/list.json +13 -0
- data/mock_json/applications/fbgraphsample.json +13 -0
- data/mock_json/applications/payments/sample.json +25 -0
- data/mock_json/applications/roles/list.json +1 -0
- data/mock_json/applications/subscriptions/fb_graph_private.json +12 -0
- data/mock_json/applications/test_users/created.json +5 -0
- data/mock_json/applications/test_users/private.json +14 -0
- data/mock_json/blank.json +0 -0
- data/mock_json/checkins/search_private.json +54 -0
- data/mock_json/checkins/search_public.json +6 -0
- data/mock_json/domains/search_public.json +10 -0
- data/mock_json/empty.json +1 -0
- data/mock_json/events/attending/post_with_valid_access_token.json +1 -0
- data/mock_json/events/attending/smartday_private.json +44 -0
- data/mock_json/events/declined/post_with_valid_access_token.json +1 -0
- data/mock_json/events/declined/smartday_private.json +720 -0
- data/mock_json/events/invited/attending.json +7 -0
- data/mock_json/events/invited/declined.json +7 -0
- data/mock_json/events/invited/not_replied.json +7 -0
- data/mock_json/events/invited/smartday_private.json +7092 -0
- data/mock_json/events/invited/unsure.json +7 -0
- data/mock_json/events/maybe/post_with_valid_access_token.json +1 -0
- data/mock_json/events/maybe/smartday_private.json +956 -0
- data/mock_json/events/noreply/smartday_private.json +896 -0
- data/mock_json/events/with_venue_as_page.json +17 -0
- data/mock_json/friend_lists/members/sample.json +82 -0
- data/mock_json/groups/docs/private.json +31 -0
- data/mock_json/groups/members/emacs_private.json +1996 -0
- data/mock_json/open_graph/created.json +1 -0
- data/mock_json/open_graph/custom_actions.json +62 -0
- data/mock_json/open_graph/play_actions.json +89 -0
- data/mock_json/pages/admins/blank.json +3 -0
- data/mock_json/pages/admins/sample.json +8 -0
- data/mock_json/pages/blocked/create.json +1 -0
- data/mock_json/pages/blocked/index.json +10 -0
- data/mock_json/pages/blocked/show_blocked.json +6 -0
- data/mock_json/pages/blocked/show_non_blocked.json +1 -0
- data/mock_json/pages/categories/local_business.json +56 -0
- data/mock_json/pages/categories/local_business_fixnum.json +56 -0
- data/mock_json/pages/categories/movie.json +15 -0
- data/mock_json/pages/categories/music.json +16 -0
- data/mock_json/pages/categories/person.json +12 -0
- data/mock_json/pages/categories/product.json +15 -0
- data/mock_json/pages/checkins/gowalla_private.json +113 -0
- data/mock_json/pages/checkins/gowalla_public.json +6 -0
- data/mock_json/pages/conversations/list.json +83 -0
- data/mock_json/pages/insights/FbGraph_private.json +858 -0
- data/mock_json/pages/insights/FbGraph_public.json +6 -0
- data/mock_json/pages/insights/page_like_adds/FbGraph_private.json +28 -0
- data/mock_json/pages/insights/page_like_adds/day/FbGraph_private.json +28 -0
- data/mock_json/pages/milestones/created.json +1 -0
- data/mock_json/pages/milestones/list.json +103 -0
- data/mock_json/pages/notes/post_with_valid_access_token.json +1 -0
- data/mock_json/pages/platform_private.json +13 -0
- data/mock_json/pages/platform_public.json +18 -0
- data/mock_json/pages/promotable_posts/sample.json +168 -0
- data/mock_json/pages/search_fb_graph.json +9 -0
- data/mock_json/pages/search_google.json +133 -0
- data/mock_json/pages/settings/all_enabled.json +20 -0
- data/mock_json/pages/settings/sample.json +20 -0
- data/mock_json/pages/statuses/platform_private.json +258 -0
- data/mock_json/pages/statuses/platform_public.json +6 -0
- data/mock_json/pages/tabs/blank.json +3 -0
- data/mock_json/pages/tabs/fb_graph.json +28 -0
- data/mock_json/pages/tabs/wall.json +12 -0
- data/mock_json/pages/with_token.json +1 -0
- data/mock_json/photos/sample.json +270 -0
- data/mock_json/photos/with_tags.json +46 -0
- data/mock_json/posts/comments/post_with_invalid_access_token.json +1 -0
- data/mock_json/posts/comments/post_with_valid_access_token.json +1 -0
- data/mock_json/posts/comments/post_without_access_token.json +1 -0
- data/mock_json/posts/liked_by_page.json +35 -0
- data/mock_json/posts/likes/post_with_invalid_access_token.json +1 -0
- data/mock_json/posts/likes/post_with_valid_access_token.json +1 -0
- data/mock_json/posts/likes/post_without_access_token.json +1 -0
- data/mock_json/posts/no_comments.json +30 -0
- data/mock_json/posts/platform_private.json +96 -0
- data/mock_json/posts/platform_public.json +60 -0
- data/mock_json/posts/to_application.json +17 -0
- data/mock_json/posts/to_event.json +20 -0
- data/mock_json/posts/to_group.json +78 -0
- data/mock_json/posts/with_message.json +40 -0
- data/mock_json/posts/with_place.json +33 -0
- data/mock_json/posts/with_story.json +28 -0
- data/mock_json/query/user/multi_query.json +14 -0
- data/mock_json/query/user/with_invalid_token.json +1 -0
- data/mock_json/query/user/with_valid_token.json +1 -0
- data/mock_json/query/user/without_token.json +1 -0
- data/mock_json/questions/options/matake_private.json +52 -0
- data/mock_json/questions/options/votes/matake_private.json +15 -0
- data/mock_json/statuses/with_likes.json +17 -0
- data/mock_json/success.json +1 -0
- data/mock_json/thread/former_participants/private.json +14 -0
- data/mock_json/thread/messages/created.json +1 -0
- data/mock_json/thread/messages/private.json +43 -0
- data/mock_json/thread/participants/private.json +14 -0
- data/mock_json/thread/senders/private.json +14 -0
- data/mock_json/token_introspection/invalid.json +15 -0
- data/mock_json/token_introspection/valid.json +10 -0
- data/mock_json/token_response.json +1 -0
- data/mock_json/token_with_expiry.json +1 -0
- data/mock_json/true.json +1 -0
- data/mock_json/users/accounts/matake_private.json +157 -0
- data/mock_json/users/accounts/matake_private_with_manage_pages_permission.json +16 -0
- data/mock_json/users/accounts/matake_public.json +6 -0
- data/mock_json/users/activities/arjun_private.json +24 -0
- data/mock_json/users/activities/arjun_public.json +6 -0
- data/mock_json/users/ad_accounts/me_ad_accounts.json +28 -0
- data/mock_json/users/albums/matake_private.json +36 -0
- data/mock_json/users/albums/matake_public.json +6 -0
- data/mock_json/users/albums/post_with_valid_access_token.json +1 -0
- data/mock_json/users/app_requests/created.json +1 -0
- data/mock_json/users/app_requests/me_private.json +40 -0
- data/mock_json/users/arjun_private.json +109 -0
- data/mock_json/users/arjun_public.json +12 -0
- data/mock_json/users/books/matake_private.json +9 -0
- data/mock_json/users/books/matake_public.json +6 -0
- data/mock_json/users/checkins/mattt_private.json +389 -0
- data/mock_json/users/checkins/mattt_public.json +6 -0
- data/mock_json/users/checkins/posted.json +1 -0
- data/mock_json/users/events/matake_private.json +71 -0
- data/mock_json/users/events/matake_public.json +6 -0
- data/mock_json/users/events/post_with_valid_access_token.json +1 -0
- data/mock_json/users/family/family_without_access_token.json +6 -0
- data/mock_json/users/family/me_public.json +19 -0
- data/mock_json/users/feed/arjun_private.json +508 -0
- data/mock_json/users/feed/arjun_public.json +508 -0
- data/mock_json/users/feed/post_with_invalid_access_token.json +1 -0
- data/mock_json/users/feed/post_with_valid_access_token.json +1 -0
- data/mock_json/users/feed/post_without_access_token.json +1 -0
- data/mock_json/users/friend_lists/created.json +1 -0
- data/mock_json/users/friend_lists/matake.json +20 -0
- data/mock_json/users/friend_requests/sample.json +19 -0
- data/mock_json/users/friends/arjun_private.json +6 -0
- data/mock_json/users/friends/arjun_public.json +6 -0
- data/mock_json/users/friends/me_private.json +524 -0
- data/mock_json/users/friends/me_public.json +6 -0
- data/mock_json/users/games/matake_private.json +10 -0
- data/mock_json/users/groups/matake_private.json +48 -0
- data/mock_json/users/groups/matake_public.json +6 -0
- data/mock_json/users/home/arjun_private.json +6 -0
- data/mock_json/users/home/arjun_public.json +6 -0
- data/mock_json/users/home/me_private.json +438 -0
- data/mock_json/users/home/me_private_next.json +357 -0
- data/mock_json/users/home/me_private_previous.json +35 -0
- data/mock_json/users/home/me_public.json +6 -0
- data/mock_json/users/inbox/before_transition.json +37 -0
- data/mock_json/users/interests/matake_private.json +14 -0
- data/mock_json/users/likes/arjun_private.json +1394 -0
- data/mock_json/users/likes/arjun_public.json +6 -0
- data/mock_json/users/likes/fb_graph.json +1 -0
- data/mock_json/users/likes/poken.json +1 -0
- data/mock_json/users/links/matake_private.json +221 -0
- data/mock_json/users/links/post_with_valid_access_token.json +1 -0
- data/mock_json/users/me_private.json +233 -0
- data/mock_json/users/me_public.json +6 -0
- data/mock_json/users/movies/matake_private.json +9 -0
- data/mock_json/users/music/matake_private.json +34 -0
- data/mock_json/users/mutual_friends/me_and_agektmr.json +126 -0
- data/mock_json/users/notes/matake_private.json +308 -0
- data/mock_json/users/notifications/all.json +407 -0
- data/mock_json/users/outbox/me_private.json +37 -0
- data/mock_json/users/permissions/me_private.json +70 -0
- data/mock_json/users/picture/success.json +6 -0
- data/mock_json/users/pokes/sample.json +1 -0
- data/mock_json/users/posts/arjun_private.json +373 -0
- data/mock_json/users/posts/arjun_public.json +373 -0
- data/mock_json/users/questions/created.json +1 -0
- data/mock_json/users/questions/sample.json +465 -0
- data/mock_json/users/scores/sample.json +14 -0
- data/mock_json/users/statuses/arjun_private.json +233 -0
- data/mock_json/users/statuses/arjun_public.json +6 -0
- data/mock_json/users/subscribed_to/sample.json +11 -0
- data/mock_json/users/subscribers/sample.json +15 -0
- data/mock_json/users/tagged/arjun_private.json +303 -0
- data/mock_json/users/tagged/arjun_public.json +303 -0
- data/mock_json/users/television/matake_private.json +9 -0
- data/mock_json/users/threads/me_private.json +91 -0
- data/mock_json/users/user_achievements/created.json +1 -0
- data/mock_json/users/user_achievements/sample.json +31 -0
- data/mock_json/users/videos/kirk_private.json +41 -0
- data/mock_json/users/videos/posted.json +1 -0
- data/mock_json/videos/private.json +78 -0
- data/spec/fb_graph/mock_spec.rb +15 -0
- data/spec/spec_helper.rb +4 -0
- metadata +350 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 nov matake
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# FbGraph::Mock
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'fb_graph-mock'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install fb_graph-mock
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
|
7
|
+
namespace :cover_me do
|
8
|
+
desc "Generates and opens code coverage report."
|
9
|
+
task :report do
|
10
|
+
require 'cover_me'
|
11
|
+
CoverMe.complete!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
task :spec do
|
16
|
+
Rake::Task['cover_me:report'].invoke
|
17
|
+
end
|
18
|
+
|
19
|
+
task :default => :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = "fb_graph-mock"
|
3
|
+
gem.version = File.read("VERSION").delete("\n\r")
|
4
|
+
gem.authors = ["nov matake"]
|
5
|
+
gem.email = ["nov@matake.jp"]
|
6
|
+
gem.description = %q{FB Graph API mocking}
|
7
|
+
gem.summary = %q{Let's share current FB Graph API response format for our FB Graph API related specs!}
|
8
|
+
gem.homepage = "http://github.com/nov/fb_graph-mock"
|
9
|
+
gem.files = `git ls-files`.split($/)
|
10
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
11
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
12
|
+
gem.require_paths = ["lib"]
|
13
|
+
gem.add_runtime_dependency "json"
|
14
|
+
gem.add_runtime_dependency "fb_graph"
|
15
|
+
gem.add_runtime_dependency "rspec"
|
16
|
+
gem.add_runtime_dependency "webmock"
|
17
|
+
gem.add_development_dependency "cover_me", ">= 1.2.0"
|
18
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require 'fb_graph'
|
2
|
+
require 'webmock/rspec'
|
3
|
+
|
4
|
+
module FbGraph
|
5
|
+
module Mock
|
6
|
+
def mock_graph(method, path, response_path, options = {})
|
7
|
+
stub_request(
|
8
|
+
method,
|
9
|
+
endpoint_for(path)
|
10
|
+
).with(
|
11
|
+
request_for(method, options)
|
12
|
+
).to_return(
|
13
|
+
response_for(response_path, options)
|
14
|
+
)
|
15
|
+
response = yield
|
16
|
+
a_request(
|
17
|
+
method,
|
18
|
+
endpoint_for(path)
|
19
|
+
).with(
|
20
|
+
request_for(method, options)
|
21
|
+
).should have_been_made.once
|
22
|
+
response
|
23
|
+
end
|
24
|
+
|
25
|
+
def mock_fql(query, response_file, options = {})
|
26
|
+
options.merge!(:params => {
|
27
|
+
:q => query
|
28
|
+
})
|
29
|
+
stub_request(:get, FbGraph::Query.new(query).endpoint).with(
|
30
|
+
request_for(:get, options)
|
31
|
+
).to_return(
|
32
|
+
response_for(response_file, options)
|
33
|
+
)
|
34
|
+
response = yield
|
35
|
+
a_request(:get, FbGraph::Query.new(query).endpoint).with(
|
36
|
+
request_for(:get, options)
|
37
|
+
).should have_been_made.once
|
38
|
+
response
|
39
|
+
end
|
40
|
+
|
41
|
+
def request_to(path, method = :get)
|
42
|
+
raise_error(WebMock::NetConnectNotAllowedError) { |e|
|
43
|
+
e.message.should include("Unregistered request: #{method.to_s.upcase}")
|
44
|
+
e.message.should include(endpoint_for path)
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def endpoint_for(path)
|
51
|
+
File.join(FbGraph::ROOT_URL, path)
|
52
|
+
end
|
53
|
+
|
54
|
+
def request_for(method, options = {})
|
55
|
+
request = {}
|
56
|
+
if options[:access_token]
|
57
|
+
options[:params] ||= {}
|
58
|
+
options[:params][:access_token] = options[:access_token].to_s
|
59
|
+
end
|
60
|
+
if options[:params]
|
61
|
+
case method
|
62
|
+
when :post, :put
|
63
|
+
request[:body] = options[:params]
|
64
|
+
else
|
65
|
+
request[:query] = options[:params]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
request
|
69
|
+
end
|
70
|
+
|
71
|
+
def response_for(response_path, options = {})
|
72
|
+
response = {}
|
73
|
+
response[:body] = response_file_for response_path
|
74
|
+
if options[:status]
|
75
|
+
response[:status] = options[:status]
|
76
|
+
end
|
77
|
+
response
|
78
|
+
end
|
79
|
+
|
80
|
+
def response_file_for(response_path)
|
81
|
+
_response_file_path_ = if File.exist? response_path
|
82
|
+
response_path
|
83
|
+
else
|
84
|
+
File.join(
|
85
|
+
File.dirname(__FILE__), '../../mock_json', "#{response_path}.json"
|
86
|
+
)
|
87
|
+
end
|
88
|
+
unless File.exist? _response_file_path_
|
89
|
+
response_file_required! response_path
|
90
|
+
end
|
91
|
+
File.new _response_file_path_
|
92
|
+
end
|
93
|
+
|
94
|
+
def response_file_required!(response_path)
|
95
|
+
warn [
|
96
|
+
'No response file found.',
|
97
|
+
'Send a pull request to fb_graph-mock gem with a JSON file!',
|
98
|
+
"(at #{File.join 'mock_json', response_path.split('mock_json').last})"
|
99
|
+
].join("\n")
|
100
|
+
end
|
101
|
+
|
102
|
+
module_function
|
103
|
+
|
104
|
+
def registered_mocks
|
105
|
+
Dir.glob(
|
106
|
+
File.join(File.dirname(__FILE__), '../../mock_json/**/*.json')
|
107
|
+
).collect do |file_path|
|
108
|
+
file_path.split('mock_json').last.sub('.json', '')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
data/mock_json/.gitkeep
ADDED
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"start_time":null,
|
3
|
+
"end_time":"2011-09-08T18:49:53+0000",
|
4
|
+
"data": [{
|
5
|
+
"id":"6002647797777/stats/0/1315507793",
|
6
|
+
"campaign_id":6002647797777,
|
7
|
+
"start_time":null,
|
8
|
+
"end_time":"2011-09-08T18:49:53+0000",
|
9
|
+
"impressions":232641,
|
10
|
+
"clicks":534,
|
11
|
+
"spent":18885,
|
12
|
+
"social_impressions":22676,
|
13
|
+
"social_clicks":81,
|
14
|
+
"social_spent":1548,
|
15
|
+
"unique_impressions":0,
|
16
|
+
"social_unique_impressions":0,
|
17
|
+
"unique_clicks":0,
|
18
|
+
"social_unique_clicks":0,
|
19
|
+
"actions":140,
|
20
|
+
"connections":0
|
21
|
+
}, {
|
22
|
+
"id":"6002824447777/stats/0/1315507793",
|
23
|
+
"campaign_id":6002824447777,
|
24
|
+
"start_time":null,
|
25
|
+
"end_time":"2011-09-08T18:49:53+0000",
|
26
|
+
"impressions":0,
|
27
|
+
"clicks":0,
|
28
|
+
"spent":0,
|
29
|
+
"social_impressions":0,
|
30
|
+
"social_clicks":0,
|
31
|
+
"social_spent":0,
|
32
|
+
"unique_impressions":0,
|
33
|
+
"social_unique_impressions":0,
|
34
|
+
"unique_clicks":0,
|
35
|
+
"social_unique_clicks":0,
|
36
|
+
"actions":0,
|
37
|
+
"connections":0
|
38
|
+
}],
|
39
|
+
"count":2,
|
40
|
+
"limit":100,
|
41
|
+
"offset":0
|
42
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"id": "6004167532222",
|
3
|
+
"data": {
|
4
|
+
"campaigns": {
|
5
|
+
"6004167532222": {
|
6
|
+
"account_id": 22334455,
|
7
|
+
"campaign_id": 6004167532222,
|
8
|
+
"name": "Campaign 1",
|
9
|
+
"daily_budget": 500,
|
10
|
+
"campaign_status": 2,
|
11
|
+
"daily_imps": 0,
|
12
|
+
"id": "6004167532222",
|
13
|
+
"start_time": 1330282800,
|
14
|
+
"end_time": 1330588800,
|
15
|
+
"updated_time": 1329850926
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"data":[
|
3
|
+
{
|
4
|
+
"id":354545238888,
|
5
|
+
"name":"MyPage",
|
6
|
+
"url":"http://www.facebook.com/MyPage",
|
7
|
+
"type":1,
|
8
|
+
"tabs":
|
9
|
+
{
|
10
|
+
"http://www.facebook.com/MyPage?sk=wall":"Wall",
|
11
|
+
"http://www.facebook.com/MyPage?sk=info":"Info",
|
12
|
+
"http://www.facebook.com/MyPage?sk=friendactivity":"Friend Activity",
|
13
|
+
"http://www.facebook.com/MyPage?sk=photos":"Photos",
|
14
|
+
"http://www.facebook.com/MyPage?sk=app_2373072222":"Discussions"
|
15
|
+
},
|
16
|
+
"picture":"http://profile.ak.fbcdn.net/hprofile-ak-snc4/41591_354545238178_3195000_s.jpg"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"id":469506610000,
|
20
|
+
"name":"My App",
|
21
|
+
"url":"http://www.facebook.com/apps/application.php?id=469506610000",
|
22
|
+
"type":2,
|
23
|
+
"tabs":[],
|
24
|
+
"picture":"http://profile.ak.fbcdn.net/static-ak/rsrc.php/v1/y0/r/XsEg9L6III_.jpg"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"id":403374556666,
|
28
|
+
"name":"www.example.com",
|
29
|
+
"url":"http://www.example.com/",
|
30
|
+
"type":7,
|
31
|
+
"tabs":[]
|
32
|
+
}
|
33
|
+
]
|
34
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
{
|
2
|
+
"start_time":null,
|
3
|
+
"end_time":"2011-09-09T22:30:03+0000",
|
4
|
+
"data":[{
|
5
|
+
"id":"6002647798444/stats/0/1315607403",
|
6
|
+
"impressions":232641,
|
7
|
+
"clicks":534,
|
8
|
+
"spent":18885,
|
9
|
+
"social_impressions":22676,
|
10
|
+
"social_clicks":81,
|
11
|
+
"social_spent":1548,
|
12
|
+
"unique_impressions":0,
|
13
|
+
"social_unique_impressions":0,
|
14
|
+
"unique_clicks":0,
|
15
|
+
"social_unique_clicks":0,
|
16
|
+
"actions":140,
|
17
|
+
"connections":0,
|
18
|
+
"adgroup_id":6002647798444,
|
19
|
+
"start_time":null,
|
20
|
+
"end_time":"2011-09-09T22:30:03+0000"
|
21
|
+
}, {
|
22
|
+
"id":"6002867067888/stats/0/1315607403",
|
23
|
+
"impressions":0,
|
24
|
+
"clicks":0,
|
25
|
+
"spent":0,
|
26
|
+
"social_impressions":0,
|
27
|
+
"social_clicks":0,
|
28
|
+
"social_spent":0,
|
29
|
+
"unique_impressions":0,
|
30
|
+
"social_unique_impressions":0,
|
31
|
+
"unique_clicks":0,
|
32
|
+
"social_unique_clicks":0,
|
33
|
+
"actions":0,
|
34
|
+
"connections":0,
|
35
|
+
"adgroup_id":6002867067888,
|
36
|
+
"start_time":null,
|
37
|
+
"end_time":"2011-09-09T22:30:03+0000"
|
38
|
+
}, {
|
39
|
+
"id":"6002935967666/stats/0/1315607403",
|
40
|
+
"impressions":0,
|
41
|
+
"clicks":0,
|
42
|
+
"spent":0,
|
43
|
+
"social_impressions":0,
|
44
|
+
"social_clicks":0,
|
45
|
+
"social_spent":0,
|
46
|
+
"unique_impressions":0,
|
47
|
+
"social_unique_impressions":0,
|
48
|
+
"unique_clicks":0,
|
49
|
+
"social_unique_clicks":0,
|
50
|
+
"actions":0,
|
51
|
+
"connections":0,
|
52
|
+
"adgroup_id":6002935967666,
|
53
|
+
"start_time":null,
|
54
|
+
"end_time":"2011-09-09T22:30:03+0000"
|
55
|
+
}],
|
56
|
+
"count":3081,
|
57
|
+
"limit":3,
|
58
|
+
"offset":0,
|
59
|
+
"paging": {
|
60
|
+
"next":"https://graph.facebook.com/act_111222333/adgroupstats?access_token=aabbccdd&offset=100"
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"adgroups": {
|
4
|
+
"22334455": {
|
5
|
+
"name": "Test Ad 2",
|
6
|
+
"adgroup_id": 22334455,
|
7
|
+
"ad_id": 22334455,
|
8
|
+
"creative_ids": [
|
9
|
+
22334455
|
10
|
+
],
|
11
|
+
"end_time": 1329955200,
|
12
|
+
"campaign_id": 11223344,
|
13
|
+
"account_id": 99887766,
|
14
|
+
"ad_status": 4,
|
15
|
+
"id": "22334455",
|
16
|
+
"max_bid": "100",
|
17
|
+
"bid_info": {
|
18
|
+
"1": "100"
|
19
|
+
},
|
20
|
+
"bid_type": 1,
|
21
|
+
"updated_time": 1329766354,
|
22
|
+
"adgroup_status": 4,
|
23
|
+
"targeting": {
|
24
|
+
"countries": [
|
25
|
+
"US"
|
26
|
+
]
|
27
|
+
},
|
28
|
+
"start_time": 1329696000
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"creatives": {
|
32
|
+
"22334455": {
|
33
|
+
"alt_view_tags": [],
|
34
|
+
"name": "asdfasdf",
|
35
|
+
"creative_id": "22334455",
|
36
|
+
"title": "asdfasdf",
|
37
|
+
"body": "fsadfasf",
|
38
|
+
"image_url": "https://fbcdn-photos-a.akamaihd.net/photos-ak-snc1/v41818/flyers/20/8/13297657711344684017_1_bd2a5cd2.jpg",
|
39
|
+
"view_tag": "",
|
40
|
+
"count_current_adgroups": 2,
|
41
|
+
"id": "22334455",
|
42
|
+
"type": 1,
|
43
|
+
"preview_url": "http://www.facebook.com/ads/api/creative_preview.php?cid=22334455",
|
44
|
+
"run_status": 1,
|
45
|
+
"image_hash": "6dda3e0bd951ff99cd474acf58a91cf4",
|
46
|
+
"link_url": "http://example.org"
|
47
|
+
}
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"id": "22334455"
|
51
|
+
}
|