palidanx-fb_graph 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +308 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/assets/fb_graph.ai +1726 -6
- data/assets/fb_graph.png +0 -0
- data/fb_graph.gemspec +327 -0
- data/lib/fb_graph.rb +75 -0
- data/lib/fb_graph/album.rb +133 -0
- data/lib/fb_graph/application.rb +57 -0
- data/lib/fb_graph/auth.rb +52 -0
- data/lib/fb_graph/auth/cookie.rb +43 -0
- data/lib/fb_graph/checkin.rb +44 -0
- data/lib/fb_graph/collection.rb +44 -0
- data/lib/fb_graph/comment.rb +20 -0
- data/lib/fb_graph/comparison.rb +9 -0
- data/lib/fb_graph/connection.rb +30 -0
- data/lib/fb_graph/connections.rb +3 -0
- data/lib/fb_graph/connections/accounts.rb +58 -0
- data/lib/fb_graph/connections/activities.rb +14 -0
- data/lib/fb_graph/connections/albums.rb +96 -0
- data/lib/fb_graph/connections/attending.rb +18 -0
- data/lib/fb_graph/connections/books.rb +14 -0
- data/lib/fb_graph/connections/checkins.rb +22 -0
- data/lib/fb_graph/connections/comments.rb +39 -0
- data/lib/fb_graph/connections/declined.rb +18 -0
- data/lib/fb_graph/connections/events.rb +21 -0
- data/lib/fb_graph/connections/feed.rb +90 -0
- data/lib/fb_graph/connections/friends.rb +14 -0
- data/lib/fb_graph/connections/groups.rb +14 -0
- data/lib/fb_graph/connections/home.rb +14 -0
- data/lib/fb_graph/connections/insights.rb +13 -0
- data/lib/fb_graph/connections/interests.rb +14 -0
- data/lib/fb_graph/connections/invited.rb +14 -0
- data/lib/fb_graph/connections/likes.rb +16 -0
- data/lib/fb_graph/connections/links.rb +21 -0
- data/lib/fb_graph/connections/maybe.rb +18 -0
- data/lib/fb_graph/connections/members.rb +14 -0
- data/lib/fb_graph/connections/movies.rb +14 -0
- data/lib/fb_graph/connections/music.rb +14 -0
- data/lib/fb_graph/connections/noreply.rb +14 -0
- data/lib/fb_graph/connections/notes.rb +21 -0
- data/lib/fb_graph/connections/photos.rb +21 -0
- data/lib/fb_graph/connections/picture.rb +14 -0
- data/lib/fb_graph/connections/posts.rb +14 -0
- data/lib/fb_graph/connections/statuses.rb +14 -0
- data/lib/fb_graph/connections/subscriptions.rb +53 -0
- data/lib/fb_graph/connections/tagged.rb +14 -0
- data/lib/fb_graph/connections/television.rb +14 -0
- data/lib/fb_graph/connections/videos.rb +14 -0
- data/lib/fb_graph/education.rb +25 -0
- data/lib/fb_graph/event.rb +47 -0
- data/lib/fb_graph/group.rb +27 -0
- data/lib/fb_graph/insight.rb +14 -0
- data/lib/fb_graph/link.rb +28 -0
- data/lib/fb_graph/node.rb +121 -0
- data/lib/fb_graph/note.rb +28 -0
- data/lib/fb_graph/page.rb +41 -0
- data/lib/fb_graph/photo.rb +41 -0
- data/lib/fb_graph/post.rb +50 -0
- data/lib/fb_graph/searchable.rb +25 -0
- data/lib/fb_graph/searchable/result.rb +31 -0
- data/lib/fb_graph/status.rb +23 -0
- data/lib/fb_graph/subscription.rb +14 -0
- data/lib/fb_graph/tag.rb +16 -0
- data/lib/fb_graph/user.rb +89 -0
- data/lib/fb_graph/venue.rb +17 -0
- data/lib/fb_graph/video.rb +28 -0
- data/lib/fb_graph/work.rb +35 -0
- data/spec/fake_json/albums/photos/matake_private.json +97 -0
- data/spec/fake_json/albums/photos/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/applications/subscriptions/fb_graph_private.json +12 -0
- data/spec/fake_json/checkins/search_private.json +54 -0
- data/spec/fake_json/checkins/search_public.json +6 -0
- data/spec/fake_json/events/attending/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/events/attending/smartday_private.json +44 -0
- data/spec/fake_json/events/declined/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/events/declined/smartday_private.json +720 -0
- data/spec/fake_json/events/invited/smartday_private.json +7092 -0
- data/spec/fake_json/events/maybe/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/events/maybe/smartday_private.json +956 -0
- data/spec/fake_json/events/noreply/smartday_private.json +896 -0
- data/spec/fake_json/groups/members/emacs_private.json +1996 -0
- data/spec/fake_json/pages/checkins/gowalla_private.json +113 -0
- data/spec/fake_json/pages/checkins/gowalla_public.json +6 -0
- data/spec/fake_json/pages/notes/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/pages/platform_private.json +13 -0
- data/spec/fake_json/pages/platform_public.json +13 -0
- data/spec/fake_json/pages/statuses/platform_private.json +258 -0
- data/spec/fake_json/pages/statuses/platform_public.json +6 -0
- data/spec/fake_json/posts/comments/post_with_invalid_access_token.json +1 -0
- data/spec/fake_json/posts/comments/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/posts/comments/post_without_access_token.json +1 -0
- data/spec/fake_json/posts/likes/post_with_invalid_access_token.json +1 -0
- data/spec/fake_json/posts/likes/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/posts/likes/post_without_access_token.json +1 -0
- data/spec/fake_json/posts/platform_private.json +97 -0
- data/spec/fake_json/posts/platform_public.json +52 -0
- data/spec/fake_json/users/accounts/matake_private.json +14 -0
- data/spec/fake_json/users/accounts/matake_private_with_manage_pages_permission.json +16 -0
- data/spec/fake_json/users/accounts/matake_public.json +6 -0
- data/spec/fake_json/users/activities/arjun_private.json +24 -0
- data/spec/fake_json/users/activities/arjun_public.json +6 -0
- data/spec/fake_json/users/albums/matake_private.json +36 -0
- data/spec/fake_json/users/albums/matake_public.json +6 -0
- data/spec/fake_json/users/albums/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/users/arjun_private.json +109 -0
- data/spec/fake_json/users/arjun_public.json +12 -0
- data/spec/fake_json/users/books/matake_private.json +9 -0
- data/spec/fake_json/users/books/matake_public.json +6 -0
- data/spec/fake_json/users/checkins/mattt_private.json +389 -0
- data/spec/fake_json/users/checkins/mattt_public.json +6 -0
- data/spec/fake_json/users/events/matake_private.json +71 -0
- data/spec/fake_json/users/events/matake_public.json +6 -0
- data/spec/fake_json/users/events/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/users/feed/arjun_private.json +520 -0
- data/spec/fake_json/users/feed/arjun_public.json +520 -0
- data/spec/fake_json/users/feed/post_with_invalid_access_token.json +1 -0
- data/spec/fake_json/users/feed/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/users/feed/post_without_access_token.json +1 -0
- data/spec/fake_json/users/friends/arjun_private.json +6 -0
- data/spec/fake_json/users/friends/arjun_public.json +6 -0
- data/spec/fake_json/users/friends/me_private.json +524 -0
- data/spec/fake_json/users/friends/me_public.json +6 -0
- data/spec/fake_json/users/groups/matake_private.json +48 -0
- data/spec/fake_json/users/groups/matake_public.json +6 -0
- data/spec/fake_json/users/home/arjun_private.json +6 -0
- data/spec/fake_json/users/home/arjun_public.json +6 -0
- data/spec/fake_json/users/home/me_private.json +460 -0
- data/spec/fake_json/users/home/me_private_next.json +382 -0
- data/spec/fake_json/users/home/me_private_previous.json +36 -0
- data/spec/fake_json/users/home/me_public.json +6 -0
- data/spec/fake_json/users/interests/matake_private.json +14 -0
- data/spec/fake_json/users/likes/arjun_private.json +1394 -0
- data/spec/fake_json/users/likes/arjun_public.json +6 -0
- data/spec/fake_json/users/links/matake_private.json +221 -0
- data/spec/fake_json/users/links/post_with_valid_access_token.json +1 -0
- data/spec/fake_json/users/me_private.json +128 -0
- data/spec/fake_json/users/me_public.json +6 -0
- data/spec/fake_json/users/movies/matake_private.json +9 -0
- data/spec/fake_json/users/music/matake_private.json +34 -0
- data/spec/fake_json/users/notes/matake_private.json +308 -0
- data/spec/fake_json/users/posts/arjun_private.json +386 -0
- data/spec/fake_json/users/posts/arjun_public.json +386 -0
- data/spec/fake_json/users/statuses/arjun_private.json +233 -0
- data/spec/fake_json/users/statuses/arjun_public.json +6 -0
- data/spec/fake_json/users/tagged/arjun_private.json +308 -0
- data/spec/fake_json/users/tagged/arjun_public.json +308 -0
- data/spec/fake_json/users/television/matake_private.json +9 -0
- data/spec/fake_json/users/videos/kirk_private.json +41 -0
- data/spec/fb_graph/album_spec.rb +61 -0
- data/spec/fb_graph/application_spec.rb +23 -0
- data/spec/fb_graph/auth_spec.rb +35 -0
- data/spec/fb_graph/checkin_spec.rb +29 -0
- data/spec/fb_graph/collection_spec.rb +45 -0
- data/spec/fb_graph/comment_spec.rb +31 -0
- data/spec/fb_graph/connection_spec.rb +38 -0
- data/spec/fb_graph/connections/accounts_spec.rb +47 -0
- data/spec/fb_graph/connections/activities_spec.rb +34 -0
- data/spec/fb_graph/connections/albums_spec.rb +60 -0
- data/spec/fb_graph/connections/attending_spec.rb +24 -0
- data/spec/fb_graph/connections/books_spec.rb +33 -0
- data/spec/fb_graph/connections/checkins_spec.rb +109 -0
- data/spec/fb_graph/connections/comments_spec.rb +85 -0
- data/spec/fb_graph/connections/declined_spec.rb +24 -0
- data/spec/fb_graph/connections/events_spec.rb +53 -0
- data/spec/fb_graph/connections/feed_spec.rb +102 -0
- data/spec/fb_graph/connections/friends_spec.rb +50 -0
- data/spec/fb_graph/connections/groups_spec.rb +32 -0
- data/spec/fb_graph/connections/home_spec.rb +58 -0
- data/spec/fb_graph/connections/interests_spec.rb +14 -0
- data/spec/fb_graph/connections/invited_spec.rb +14 -0
- data/spec/fb_graph/connections/likes_spec.rb +33 -0
- data/spec/fb_graph/connections/links_spec.rb +33 -0
- data/spec/fb_graph/connections/maybe_spec.rb +24 -0
- data/spec/fb_graph/connections/members_spec.rb +14 -0
- data/spec/fb_graph/connections/movies_spec.rb +14 -0
- data/spec/fb_graph/connections/music_spec.rb +14 -0
- data/spec/fb_graph/connections/noreply_spec.rb +14 -0
- data/spec/fb_graph/connections/notes_spec.rb +32 -0
- data/spec/fb_graph/connections/photos_spec.rb +30 -0
- data/spec/fb_graph/connections/picture_spec.rb +29 -0
- data/spec/fb_graph/connections/posts_spec.rb +35 -0
- data/spec/fb_graph/connections/statuses_spec.rb +74 -0
- data/spec/fb_graph/connections/subscriptions_spec.rb +18 -0
- data/spec/fb_graph/connections/tagged_spec.rb +42 -0
- data/spec/fb_graph/connections/television_spec.rb +14 -0
- data/spec/fb_graph/connections/videos_spec.rb +14 -0
- data/spec/fb_graph/education_spec.rb +61 -0
- data/spec/fb_graph/event_spec.rb +50 -0
- data/spec/fb_graph/group_spec.rb +46 -0
- data/spec/fb_graph/insight_spec.rb +17 -0
- data/spec/fb_graph/link_spec.rb +43 -0
- data/spec/fb_graph/node_spec.rb +13 -0
- data/spec/fb_graph/note_spec.rb +37 -0
- data/spec/fb_graph/page_spec.rb +56 -0
- data/spec/fb_graph/photo_spec.rb +60 -0
- data/spec/fb_graph/post_spec.rb +71 -0
- data/spec/fb_graph/status_spec.rb +31 -0
- data/spec/fb_graph/subscription_spec.rb +5 -0
- data/spec/fb_graph/tag_spec.rb +20 -0
- data/spec/fb_graph/user_spec.rb +139 -0
- data/spec/fb_graph/venue_spec.rb +23 -0
- data/spec/fb_graph/video_spec.rb +37 -0
- data/spec/fb_graph/work_spec.rb +67 -0
- data/spec/helpers/fake_json_helper.rb +11 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +18 -0
- metadata +414 -0
data/assets/fb_graph.png
ADDED
Binary file
|
data/fb_graph.gemspec
ADDED
@@ -0,0 +1,327 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{fb_graph}
|
8
|
+
s.version = "1.0.4"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["nov matake"]
|
12
|
+
s.date = %q{2010-09-15}
|
13
|
+
s.description = %q{A full-stack Facebook Graph API wrapper in Ruby.}
|
14
|
+
s.email = %q{nov@matake.jp}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"assets/fb_graph.ai",
|
27
|
+
"assets/fb_graph.png",
|
28
|
+
"fb_graph.gemspec",
|
29
|
+
"lib/fb_graph.rb",
|
30
|
+
"lib/fb_graph/album.rb",
|
31
|
+
"lib/fb_graph/application.rb",
|
32
|
+
"lib/fb_graph/auth.rb",
|
33
|
+
"lib/fb_graph/auth/cookie.rb",
|
34
|
+
"lib/fb_graph/checkin.rb",
|
35
|
+
"lib/fb_graph/collection.rb",
|
36
|
+
"lib/fb_graph/comment.rb",
|
37
|
+
"lib/fb_graph/comparison.rb",
|
38
|
+
"lib/fb_graph/connection.rb",
|
39
|
+
"lib/fb_graph/connections.rb",
|
40
|
+
"lib/fb_graph/connections/accounts.rb",
|
41
|
+
"lib/fb_graph/connections/activities.rb",
|
42
|
+
"lib/fb_graph/connections/albums.rb",
|
43
|
+
"lib/fb_graph/connections/attending.rb",
|
44
|
+
"lib/fb_graph/connections/books.rb",
|
45
|
+
"lib/fb_graph/connections/checkins.rb",
|
46
|
+
"lib/fb_graph/connections/comments.rb",
|
47
|
+
"lib/fb_graph/connections/declined.rb",
|
48
|
+
"lib/fb_graph/connections/events.rb",
|
49
|
+
"lib/fb_graph/connections/feed.rb",
|
50
|
+
"lib/fb_graph/connections/friends.rb",
|
51
|
+
"lib/fb_graph/connections/groups.rb",
|
52
|
+
"lib/fb_graph/connections/home.rb",
|
53
|
+
"lib/fb_graph/connections/insights.rb",
|
54
|
+
"lib/fb_graph/connections/interests.rb",
|
55
|
+
"lib/fb_graph/connections/invited.rb",
|
56
|
+
"lib/fb_graph/connections/likes.rb",
|
57
|
+
"lib/fb_graph/connections/links.rb",
|
58
|
+
"lib/fb_graph/connections/maybe.rb",
|
59
|
+
"lib/fb_graph/connections/members.rb",
|
60
|
+
"lib/fb_graph/connections/movies.rb",
|
61
|
+
"lib/fb_graph/connections/music.rb",
|
62
|
+
"lib/fb_graph/connections/noreply.rb",
|
63
|
+
"lib/fb_graph/connections/notes.rb",
|
64
|
+
"lib/fb_graph/connections/photos.rb",
|
65
|
+
"lib/fb_graph/connections/picture.rb",
|
66
|
+
"lib/fb_graph/connections/posts.rb",
|
67
|
+
"lib/fb_graph/connections/statuses.rb",
|
68
|
+
"lib/fb_graph/connections/subscriptions.rb",
|
69
|
+
"lib/fb_graph/connections/tagged.rb",
|
70
|
+
"lib/fb_graph/connections/television.rb",
|
71
|
+
"lib/fb_graph/connections/videos.rb",
|
72
|
+
"lib/fb_graph/education.rb",
|
73
|
+
"lib/fb_graph/event.rb",
|
74
|
+
"lib/fb_graph/group.rb",
|
75
|
+
"lib/fb_graph/insight.rb",
|
76
|
+
"lib/fb_graph/link.rb",
|
77
|
+
"lib/fb_graph/node.rb",
|
78
|
+
"lib/fb_graph/note.rb",
|
79
|
+
"lib/fb_graph/page.rb",
|
80
|
+
"lib/fb_graph/photo.rb",
|
81
|
+
"lib/fb_graph/post.rb",
|
82
|
+
"lib/fb_graph/searchable.rb",
|
83
|
+
"lib/fb_graph/searchable/result.rb",
|
84
|
+
"lib/fb_graph/status.rb",
|
85
|
+
"lib/fb_graph/subscription.rb",
|
86
|
+
"lib/fb_graph/tag.rb",
|
87
|
+
"lib/fb_graph/user.rb",
|
88
|
+
"lib/fb_graph/venue.rb",
|
89
|
+
"lib/fb_graph/video.rb",
|
90
|
+
"lib/fb_graph/work.rb",
|
91
|
+
"spec/fake_json/albums/photos/matake_private.json",
|
92
|
+
"spec/fake_json/albums/photos/post_with_valid_access_token.json",
|
93
|
+
"spec/fake_json/applications/subscriptions/fb_graph_private.json",
|
94
|
+
"spec/fake_json/checkins/search_private.json",
|
95
|
+
"spec/fake_json/checkins/search_public.json",
|
96
|
+
"spec/fake_json/events/attending/post_with_valid_access_token.json",
|
97
|
+
"spec/fake_json/events/attending/smartday_private.json",
|
98
|
+
"spec/fake_json/events/declined/post_with_valid_access_token.json",
|
99
|
+
"spec/fake_json/events/declined/smartday_private.json",
|
100
|
+
"spec/fake_json/events/invited/smartday_private.json",
|
101
|
+
"spec/fake_json/events/maybe/post_with_valid_access_token.json",
|
102
|
+
"spec/fake_json/events/maybe/smartday_private.json",
|
103
|
+
"spec/fake_json/events/noreply/smartday_private.json",
|
104
|
+
"spec/fake_json/groups/members/emacs_private.json",
|
105
|
+
"spec/fake_json/pages/checkins/gowalla_private.json",
|
106
|
+
"spec/fake_json/pages/checkins/gowalla_public.json",
|
107
|
+
"spec/fake_json/pages/notes/post_with_valid_access_token.json",
|
108
|
+
"spec/fake_json/pages/platform_private.json",
|
109
|
+
"spec/fake_json/pages/platform_public.json",
|
110
|
+
"spec/fake_json/pages/statuses/platform_private.json",
|
111
|
+
"spec/fake_json/pages/statuses/platform_public.json",
|
112
|
+
"spec/fake_json/posts/comments/post_with_invalid_access_token.json",
|
113
|
+
"spec/fake_json/posts/comments/post_with_valid_access_token.json",
|
114
|
+
"spec/fake_json/posts/comments/post_without_access_token.json",
|
115
|
+
"spec/fake_json/posts/likes/post_with_invalid_access_token.json",
|
116
|
+
"spec/fake_json/posts/likes/post_with_valid_access_token.json",
|
117
|
+
"spec/fake_json/posts/likes/post_without_access_token.json",
|
118
|
+
"spec/fake_json/posts/platform_private.json",
|
119
|
+
"spec/fake_json/posts/platform_public.json",
|
120
|
+
"spec/fake_json/users/accounts/matake_private.json",
|
121
|
+
"spec/fake_json/users/accounts/matake_private_with_manage_pages_permission.json",
|
122
|
+
"spec/fake_json/users/accounts/matake_public.json",
|
123
|
+
"spec/fake_json/users/activities/arjun_private.json",
|
124
|
+
"spec/fake_json/users/activities/arjun_public.json",
|
125
|
+
"spec/fake_json/users/albums/matake_private.json",
|
126
|
+
"spec/fake_json/users/albums/matake_public.json",
|
127
|
+
"spec/fake_json/users/albums/post_with_valid_access_token.json",
|
128
|
+
"spec/fake_json/users/arjun_private.json",
|
129
|
+
"spec/fake_json/users/arjun_public.json",
|
130
|
+
"spec/fake_json/users/books/matake_private.json",
|
131
|
+
"spec/fake_json/users/books/matake_public.json",
|
132
|
+
"spec/fake_json/users/checkins/mattt_private.json",
|
133
|
+
"spec/fake_json/users/checkins/mattt_public.json",
|
134
|
+
"spec/fake_json/users/events/matake_private.json",
|
135
|
+
"spec/fake_json/users/events/matake_public.json",
|
136
|
+
"spec/fake_json/users/events/post_with_valid_access_token.json",
|
137
|
+
"spec/fake_json/users/feed/arjun_private.json",
|
138
|
+
"spec/fake_json/users/feed/arjun_public.json",
|
139
|
+
"spec/fake_json/users/feed/post_with_invalid_access_token.json",
|
140
|
+
"spec/fake_json/users/feed/post_with_valid_access_token.json",
|
141
|
+
"spec/fake_json/users/feed/post_without_access_token.json",
|
142
|
+
"spec/fake_json/users/friends/arjun_private.json",
|
143
|
+
"spec/fake_json/users/friends/arjun_public.json",
|
144
|
+
"spec/fake_json/users/friends/me_private.json",
|
145
|
+
"spec/fake_json/users/friends/me_public.json",
|
146
|
+
"spec/fake_json/users/groups/matake_private.json",
|
147
|
+
"spec/fake_json/users/groups/matake_public.json",
|
148
|
+
"spec/fake_json/users/home/arjun_private.json",
|
149
|
+
"spec/fake_json/users/home/arjun_public.json",
|
150
|
+
"spec/fake_json/users/home/me_private.json",
|
151
|
+
"spec/fake_json/users/home/me_private_next.json",
|
152
|
+
"spec/fake_json/users/home/me_private_previous.json",
|
153
|
+
"spec/fake_json/users/home/me_public.json",
|
154
|
+
"spec/fake_json/users/interests/matake_private.json",
|
155
|
+
"spec/fake_json/users/likes/arjun_private.json",
|
156
|
+
"spec/fake_json/users/likes/arjun_public.json",
|
157
|
+
"spec/fake_json/users/links/matake_private.json",
|
158
|
+
"spec/fake_json/users/links/post_with_valid_access_token.json",
|
159
|
+
"spec/fake_json/users/me_private.json",
|
160
|
+
"spec/fake_json/users/me_public.json",
|
161
|
+
"spec/fake_json/users/movies/matake_private.json",
|
162
|
+
"spec/fake_json/users/music/matake_private.json",
|
163
|
+
"spec/fake_json/users/notes/matake_private.json",
|
164
|
+
"spec/fake_json/users/posts/arjun_private.json",
|
165
|
+
"spec/fake_json/users/posts/arjun_public.json",
|
166
|
+
"spec/fake_json/users/statuses/arjun_private.json",
|
167
|
+
"spec/fake_json/users/statuses/arjun_public.json",
|
168
|
+
"spec/fake_json/users/tagged/arjun_private.json",
|
169
|
+
"spec/fake_json/users/tagged/arjun_public.json",
|
170
|
+
"spec/fake_json/users/television/matake_private.json",
|
171
|
+
"spec/fake_json/users/videos/kirk_private.json",
|
172
|
+
"spec/fb_graph/album_spec.rb",
|
173
|
+
"spec/fb_graph/application_spec.rb",
|
174
|
+
"spec/fb_graph/auth_spec.rb",
|
175
|
+
"spec/fb_graph/checkin_spec.rb",
|
176
|
+
"spec/fb_graph/collection_spec.rb",
|
177
|
+
"spec/fb_graph/comment_spec.rb",
|
178
|
+
"spec/fb_graph/connection_spec.rb",
|
179
|
+
"spec/fb_graph/connections/accounts_spec.rb",
|
180
|
+
"spec/fb_graph/connections/activities_spec.rb",
|
181
|
+
"spec/fb_graph/connections/albums_spec.rb",
|
182
|
+
"spec/fb_graph/connections/attending_spec.rb",
|
183
|
+
"spec/fb_graph/connections/books_spec.rb",
|
184
|
+
"spec/fb_graph/connections/checkins_spec.rb",
|
185
|
+
"spec/fb_graph/connections/comments_spec.rb",
|
186
|
+
"spec/fb_graph/connections/declined_spec.rb",
|
187
|
+
"spec/fb_graph/connections/events_spec.rb",
|
188
|
+
"spec/fb_graph/connections/feed_spec.rb",
|
189
|
+
"spec/fb_graph/connections/friends_spec.rb",
|
190
|
+
"spec/fb_graph/connections/groups_spec.rb",
|
191
|
+
"spec/fb_graph/connections/home_spec.rb",
|
192
|
+
"spec/fb_graph/connections/interests_spec.rb",
|
193
|
+
"spec/fb_graph/connections/invited_spec.rb",
|
194
|
+
"spec/fb_graph/connections/likes_spec.rb",
|
195
|
+
"spec/fb_graph/connections/links_spec.rb",
|
196
|
+
"spec/fb_graph/connections/maybe_spec.rb",
|
197
|
+
"spec/fb_graph/connections/members_spec.rb",
|
198
|
+
"spec/fb_graph/connections/movies_spec.rb",
|
199
|
+
"spec/fb_graph/connections/music_spec.rb",
|
200
|
+
"spec/fb_graph/connections/noreply_spec.rb",
|
201
|
+
"spec/fb_graph/connections/notes_spec.rb",
|
202
|
+
"spec/fb_graph/connections/photos_spec.rb",
|
203
|
+
"spec/fb_graph/connections/picture_spec.rb",
|
204
|
+
"spec/fb_graph/connections/posts_spec.rb",
|
205
|
+
"spec/fb_graph/connections/statuses_spec.rb",
|
206
|
+
"spec/fb_graph/connections/subscriptions_spec.rb",
|
207
|
+
"spec/fb_graph/connections/tagged_spec.rb",
|
208
|
+
"spec/fb_graph/connections/television_spec.rb",
|
209
|
+
"spec/fb_graph/connections/videos_spec.rb",
|
210
|
+
"spec/fb_graph/education_spec.rb",
|
211
|
+
"spec/fb_graph/event_spec.rb",
|
212
|
+
"spec/fb_graph/group_spec.rb",
|
213
|
+
"spec/fb_graph/insight_spec.rb",
|
214
|
+
"spec/fb_graph/link_spec.rb",
|
215
|
+
"spec/fb_graph/node_spec.rb",
|
216
|
+
"spec/fb_graph/note_spec.rb",
|
217
|
+
"spec/fb_graph/page_spec.rb",
|
218
|
+
"spec/fb_graph/photo_spec.rb",
|
219
|
+
"spec/fb_graph/post_spec.rb",
|
220
|
+
"spec/fb_graph/status_spec.rb",
|
221
|
+
"spec/fb_graph/subscription_spec.rb",
|
222
|
+
"spec/fb_graph/tag_spec.rb",
|
223
|
+
"spec/fb_graph/user_spec.rb",
|
224
|
+
"spec/fb_graph/venue_spec.rb",
|
225
|
+
"spec/fb_graph/video_spec.rb",
|
226
|
+
"spec/fb_graph/work_spec.rb",
|
227
|
+
"spec/helpers/fake_json_helper.rb",
|
228
|
+
"spec/spec.opts",
|
229
|
+
"spec/spec_helper.rb"
|
230
|
+
]
|
231
|
+
s.homepage = %q{http://github.com/nov/fb_graph}
|
232
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
233
|
+
s.require_paths = ["lib"]
|
234
|
+
s.rubygems_version = %q{1.3.7}
|
235
|
+
s.summary = %q{A full-stack Facebook Graph API wrapper in Ruby.}
|
236
|
+
s.test_files = [
|
237
|
+
"spec/fb_graph/album_spec.rb",
|
238
|
+
"spec/fb_graph/application_spec.rb",
|
239
|
+
"spec/fb_graph/auth_spec.rb",
|
240
|
+
"spec/fb_graph/checkin_spec.rb",
|
241
|
+
"spec/fb_graph/collection_spec.rb",
|
242
|
+
"spec/fb_graph/comment_spec.rb",
|
243
|
+
"spec/fb_graph/connection_spec.rb",
|
244
|
+
"spec/fb_graph/connections/accounts_spec.rb",
|
245
|
+
"spec/fb_graph/connections/activities_spec.rb",
|
246
|
+
"spec/fb_graph/connections/albums_spec.rb",
|
247
|
+
"spec/fb_graph/connections/attending_spec.rb",
|
248
|
+
"spec/fb_graph/connections/books_spec.rb",
|
249
|
+
"spec/fb_graph/connections/checkins_spec.rb",
|
250
|
+
"spec/fb_graph/connections/comments_spec.rb",
|
251
|
+
"spec/fb_graph/connections/declined_spec.rb",
|
252
|
+
"spec/fb_graph/connections/events_spec.rb",
|
253
|
+
"spec/fb_graph/connections/feed_spec.rb",
|
254
|
+
"spec/fb_graph/connections/friends_spec.rb",
|
255
|
+
"spec/fb_graph/connections/groups_spec.rb",
|
256
|
+
"spec/fb_graph/connections/home_spec.rb",
|
257
|
+
"spec/fb_graph/connections/interests_spec.rb",
|
258
|
+
"spec/fb_graph/connections/invited_spec.rb",
|
259
|
+
"spec/fb_graph/connections/likes_spec.rb",
|
260
|
+
"spec/fb_graph/connections/links_spec.rb",
|
261
|
+
"spec/fb_graph/connections/maybe_spec.rb",
|
262
|
+
"spec/fb_graph/connections/members_spec.rb",
|
263
|
+
"spec/fb_graph/connections/movies_spec.rb",
|
264
|
+
"spec/fb_graph/connections/music_spec.rb",
|
265
|
+
"spec/fb_graph/connections/noreply_spec.rb",
|
266
|
+
"spec/fb_graph/connections/notes_spec.rb",
|
267
|
+
"spec/fb_graph/connections/photos_spec.rb",
|
268
|
+
"spec/fb_graph/connections/picture_spec.rb",
|
269
|
+
"spec/fb_graph/connections/posts_spec.rb",
|
270
|
+
"spec/fb_graph/connections/statuses_spec.rb",
|
271
|
+
"spec/fb_graph/connections/subscriptions_spec.rb",
|
272
|
+
"spec/fb_graph/connections/tagged_spec.rb",
|
273
|
+
"spec/fb_graph/connections/television_spec.rb",
|
274
|
+
"spec/fb_graph/connections/videos_spec.rb",
|
275
|
+
"spec/fb_graph/education_spec.rb",
|
276
|
+
"spec/fb_graph/event_spec.rb",
|
277
|
+
"spec/fb_graph/group_spec.rb",
|
278
|
+
"spec/fb_graph/insight_spec.rb",
|
279
|
+
"spec/fb_graph/link_spec.rb",
|
280
|
+
"spec/fb_graph/node_spec.rb",
|
281
|
+
"spec/fb_graph/note_spec.rb",
|
282
|
+
"spec/fb_graph/page_spec.rb",
|
283
|
+
"spec/fb_graph/photo_spec.rb",
|
284
|
+
"spec/fb_graph/post_spec.rb",
|
285
|
+
"spec/fb_graph/status_spec.rb",
|
286
|
+
"spec/fb_graph/subscription_spec.rb",
|
287
|
+
"spec/fb_graph/tag_spec.rb",
|
288
|
+
"spec/fb_graph/user_spec.rb",
|
289
|
+
"spec/fb_graph/venue_spec.rb",
|
290
|
+
"spec/fb_graph/video_spec.rb",
|
291
|
+
"spec/fb_graph/work_spec.rb",
|
292
|
+
"spec/helpers/fake_json_helper.rb",
|
293
|
+
"spec/spec_helper.rb"
|
294
|
+
]
|
295
|
+
|
296
|
+
if s.respond_to? :specification_version then
|
297
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
298
|
+
s.specification_version = 3
|
299
|
+
|
300
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
301
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
302
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
303
|
+
s.add_runtime_dependency(%q<rest-client>, [">= 1.4"])
|
304
|
+
s.add_runtime_dependency(%q<oauth2>, [">= 0.0.10"])
|
305
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
306
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
307
|
+
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
308
|
+
else
|
309
|
+
s.add_dependency(%q<json>, [">= 0"])
|
310
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
311
|
+
s.add_dependency(%q<rest-client>, [">= 1.4"])
|
312
|
+
s.add_dependency(%q<oauth2>, [">= 0.0.10"])
|
313
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
314
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
315
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
316
|
+
end
|
317
|
+
else
|
318
|
+
s.add_dependency(%q<json>, [">= 0"])
|
319
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
320
|
+
s.add_dependency(%q<rest-client>, [">= 1.4"])
|
321
|
+
s.add_dependency(%q<oauth2>, [">= 0.0.10"])
|
322
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
323
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
324
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
data/lib/fb_graph.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'json'
|
3
|
+
require 'restclient'
|
4
|
+
require 'oauth2'
|
5
|
+
|
6
|
+
# NOTE:
|
7
|
+
# For some reason, ActiveSupport 3.0.0 doesn'tj load whole code.
|
8
|
+
# Load needed extention directly for now.
|
9
|
+
require 'active_support/core_ext'
|
10
|
+
|
11
|
+
module FbGraph
|
12
|
+
ROOT_URL = "https://graph.facebook.com"
|
13
|
+
|
14
|
+
class Exception < StandardError
|
15
|
+
attr_accessor :code, :type, :message
|
16
|
+
def initialize(code, message, body = '')
|
17
|
+
@code = code
|
18
|
+
if body.blank?
|
19
|
+
@message = message
|
20
|
+
else
|
21
|
+
response = JSON.parse(body).with_indifferent_access
|
22
|
+
@message = response[:error][:message]
|
23
|
+
@type = response[:error][:type]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class BadRequest < FbGraph::Exception
|
29
|
+
def initialize(message, body = '')
|
30
|
+
super 400, message, body
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class Unauthorized < FbGraph::Exception
|
35
|
+
def initialize(message, body = '')
|
36
|
+
super 401, message, body
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class NotFound < FbGraph::Exception
|
41
|
+
def initialize(message, body = '')
|
42
|
+
super 404, message, body
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
require 'fb_graph/auth'
|
49
|
+
require 'fb_graph/comparison'
|
50
|
+
require 'fb_graph/collection'
|
51
|
+
require 'fb_graph/connection'
|
52
|
+
require 'fb_graph/connections'
|
53
|
+
require 'fb_graph/searchable'
|
54
|
+
|
55
|
+
require 'fb_graph/node'
|
56
|
+
require 'fb_graph/album'
|
57
|
+
require 'fb_graph/application'
|
58
|
+
require 'fb_graph/checkin'
|
59
|
+
require 'fb_graph/comment'
|
60
|
+
require 'fb_graph/education'
|
61
|
+
require 'fb_graph/event'
|
62
|
+
require 'fb_graph/group'
|
63
|
+
require 'fb_graph/insight'
|
64
|
+
require 'fb_graph/link'
|
65
|
+
require 'fb_graph/note'
|
66
|
+
require 'fb_graph/page'
|
67
|
+
require 'fb_graph/photo'
|
68
|
+
require 'fb_graph/post'
|
69
|
+
require 'fb_graph/status'
|
70
|
+
require 'fb_graph/subscription'
|
71
|
+
require 'fb_graph/tag'
|
72
|
+
require 'fb_graph/user'
|
73
|
+
require 'fb_graph/venue'
|
74
|
+
require 'fb_graph/video'
|
75
|
+
require 'fb_graph/work'
|
@@ -0,0 +1,133 @@
|
|
1
|
+
module FbGraph
|
2
|
+
# = Authentication
|
3
|
+
#
|
4
|
+
# * Access token is required to fetch album info.
|
5
|
+
#
|
6
|
+
# = Attributes
|
7
|
+
#
|
8
|
+
# +from+:: FbGraph::User or FbGraph::Page
|
9
|
+
# +name+:: String
|
10
|
+
# +description+:: String
|
11
|
+
# +location+:: String <em>ex.) "NYC"</em>
|
12
|
+
# +link+:: String
|
13
|
+
# +privacy+:: String <em>ex.) "everyone"</em>
|
14
|
+
# +count+:: Integer
|
15
|
+
# +created_time+:: Time (UTC)
|
16
|
+
# +updated_time+:: Time (UTC)
|
17
|
+
#
|
18
|
+
# = Connections
|
19
|
+
#
|
20
|
+
# +photos+:: Array of FbGraph::Photo
|
21
|
+
# +comments+:: Array of FbGraph::Comment
|
22
|
+
# +likes+:: Array of FbGraph::Page
|
23
|
+
#
|
24
|
+
# = Examples
|
25
|
+
#
|
26
|
+
# == Fetch album info
|
27
|
+
#
|
28
|
+
# album = FbGraph::Album.new(ALBUM_ID)
|
29
|
+
# album.fetch(:access_token => ACCESS_TOKEN)
|
30
|
+
#
|
31
|
+
# or
|
32
|
+
#
|
33
|
+
# FbGraph::album.fetch(ALBUM_ID, :access_token => ACCESS_TOKEN)
|
34
|
+
#
|
35
|
+
# == Fetch connection
|
36
|
+
#
|
37
|
+
# photos = album.photos
|
38
|
+
# likes = album.likes
|
39
|
+
# comments = album.comments
|
40
|
+
#
|
41
|
+
# === Pagination
|
42
|
+
#
|
43
|
+
# photos = album.photos
|
44
|
+
# photos_next = photos.next
|
45
|
+
# photos_previous = photos.previous
|
46
|
+
# photos = album.photos(:since => '2010-09-01', :until => '2010-10-01')
|
47
|
+
# photos = album.photos(:offset => 20, :limit => 20)
|
48
|
+
#
|
49
|
+
# == Creat new album
|
50
|
+
#
|
51
|
+
# See RDoc for FbGraph::Connections::Albums
|
52
|
+
#
|
53
|
+
# == Upload a photo
|
54
|
+
#
|
55
|
+
# album.photo!(
|
56
|
+
# :image => File.new(File.join(File.dirname(__FILE__), 'nov.gif')),
|
57
|
+
# :name => "name",
|
58
|
+
# :message => 'message'
|
59
|
+
# )
|
60
|
+
#
|
61
|
+
# == Post a comment
|
62
|
+
#
|
63
|
+
# album.comment!(
|
64
|
+
# :access_token => ACCESS_TOKEN,
|
65
|
+
# :message => 'Hey, I\'m testing you!'
|
66
|
+
# )
|
67
|
+
#
|
68
|
+
# == Delete a comment
|
69
|
+
#
|
70
|
+
# comment = album.comments.last
|
71
|
+
# comment.destroy
|
72
|
+
#
|
73
|
+
# == Like and unlike
|
74
|
+
#
|
75
|
+
# album.like!
|
76
|
+
# album.unlike!
|
77
|
+
#
|
78
|
+
# = Notes
|
79
|
+
#
|
80
|
+
# == Attribute +from+
|
81
|
+
#
|
82
|
+
# Both facebook user and page can have albums, so +from+ can be either FbGraph::User or FbGraph::Page.
|
83
|
+
# * When you called +ablums+ connection of FbGraph::User, all +from+ should be FbGraph::User.
|
84
|
+
# * When you called +ablums+ connection of FbGraph::Page, all +from+ should be FbGraph::Page.
|
85
|
+
# * When you fetched an album by objedt id, +from+ can be either FbGraph::User or FbGraph::Page.
|
86
|
+
#
|
87
|
+
# == Cached +comments+
|
88
|
+
#
|
89
|
+
# When album object fetched, several comments are included in the response.
|
90
|
+
# So first time you called +album.comments+, those cached comments will be returned.
|
91
|
+
# If you put any option parameter like +album.comments(:access_token => ACCESS_TOKEN)+,
|
92
|
+
# fb_graph ignores those cached comments and fetch comments via Graph API.
|
93
|
+
#
|
94
|
+
# <em>If cached "album.comments" are blank, probably the album has no comments yet.</em>
|
95
|
+
class Album < Node
|
96
|
+
include Connections::Photos
|
97
|
+
include Connections::Comments
|
98
|
+
include Connections::Likes
|
99
|
+
|
100
|
+
attr_accessor :from, :name, :description, :location, :link, :privacy, :count, :created_time, :updated_time
|
101
|
+
|
102
|
+
def initialize(identifier, attributes = {})
|
103
|
+
super
|
104
|
+
@from = if (from = attributes[:from])
|
105
|
+
if from[:category]
|
106
|
+
FbGraph::Page.new(from.delete(:id), from)
|
107
|
+
else
|
108
|
+
FbGraph::User.new(from.delete(:id), from)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
@name = attributes[:name]
|
112
|
+
# NOTE:
|
113
|
+
# for some reason, facebook uses different parameter names.
|
114
|
+
# "description" in GET & "message" in POST
|
115
|
+
# TODO:
|
116
|
+
# check whether this issue is solved or not
|
117
|
+
@description = attributes[:description] || attributes[:message]
|
118
|
+
@location = attributes[:location]
|
119
|
+
@link = attributes[:link]
|
120
|
+
@privacy = attributes[:privacy]
|
121
|
+
@count = attributes[:count]
|
122
|
+
@created_time = if attributes[:created_time]
|
123
|
+
Time.parse(attributes[:created_time]).utc
|
124
|
+
end
|
125
|
+
@updated_time = if attributes[:updated_time]
|
126
|
+
Time.parse(attributes[:updated_time]).utc
|
127
|
+
end
|
128
|
+
|
129
|
+
# cached connection
|
130
|
+
@_comments_ = FbGraph::Collection.new(attributes[:comments])
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|