palidanx-fb_graph 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +308 -0
  5. data/Rakefile +49 -0
  6. data/VERSION +1 -0
  7. data/assets/fb_graph.ai +1726 -6
  8. data/assets/fb_graph.png +0 -0
  9. data/fb_graph.gemspec +327 -0
  10. data/lib/fb_graph.rb +75 -0
  11. data/lib/fb_graph/album.rb +133 -0
  12. data/lib/fb_graph/application.rb +57 -0
  13. data/lib/fb_graph/auth.rb +52 -0
  14. data/lib/fb_graph/auth/cookie.rb +43 -0
  15. data/lib/fb_graph/checkin.rb +44 -0
  16. data/lib/fb_graph/collection.rb +44 -0
  17. data/lib/fb_graph/comment.rb +20 -0
  18. data/lib/fb_graph/comparison.rb +9 -0
  19. data/lib/fb_graph/connection.rb +30 -0
  20. data/lib/fb_graph/connections.rb +3 -0
  21. data/lib/fb_graph/connections/accounts.rb +58 -0
  22. data/lib/fb_graph/connections/activities.rb +14 -0
  23. data/lib/fb_graph/connections/albums.rb +96 -0
  24. data/lib/fb_graph/connections/attending.rb +18 -0
  25. data/lib/fb_graph/connections/books.rb +14 -0
  26. data/lib/fb_graph/connections/checkins.rb +22 -0
  27. data/lib/fb_graph/connections/comments.rb +39 -0
  28. data/lib/fb_graph/connections/declined.rb +18 -0
  29. data/lib/fb_graph/connections/events.rb +21 -0
  30. data/lib/fb_graph/connections/feed.rb +90 -0
  31. data/lib/fb_graph/connections/friends.rb +14 -0
  32. data/lib/fb_graph/connections/groups.rb +14 -0
  33. data/lib/fb_graph/connections/home.rb +14 -0
  34. data/lib/fb_graph/connections/insights.rb +13 -0
  35. data/lib/fb_graph/connections/interests.rb +14 -0
  36. data/lib/fb_graph/connections/invited.rb +14 -0
  37. data/lib/fb_graph/connections/likes.rb +16 -0
  38. data/lib/fb_graph/connections/links.rb +21 -0
  39. data/lib/fb_graph/connections/maybe.rb +18 -0
  40. data/lib/fb_graph/connections/members.rb +14 -0
  41. data/lib/fb_graph/connections/movies.rb +14 -0
  42. data/lib/fb_graph/connections/music.rb +14 -0
  43. data/lib/fb_graph/connections/noreply.rb +14 -0
  44. data/lib/fb_graph/connections/notes.rb +21 -0
  45. data/lib/fb_graph/connections/photos.rb +21 -0
  46. data/lib/fb_graph/connections/picture.rb +14 -0
  47. data/lib/fb_graph/connections/posts.rb +14 -0
  48. data/lib/fb_graph/connections/statuses.rb +14 -0
  49. data/lib/fb_graph/connections/subscriptions.rb +53 -0
  50. data/lib/fb_graph/connections/tagged.rb +14 -0
  51. data/lib/fb_graph/connections/television.rb +14 -0
  52. data/lib/fb_graph/connections/videos.rb +14 -0
  53. data/lib/fb_graph/education.rb +25 -0
  54. data/lib/fb_graph/event.rb +47 -0
  55. data/lib/fb_graph/group.rb +27 -0
  56. data/lib/fb_graph/insight.rb +14 -0
  57. data/lib/fb_graph/link.rb +28 -0
  58. data/lib/fb_graph/node.rb +121 -0
  59. data/lib/fb_graph/note.rb +28 -0
  60. data/lib/fb_graph/page.rb +41 -0
  61. data/lib/fb_graph/photo.rb +41 -0
  62. data/lib/fb_graph/post.rb +50 -0
  63. data/lib/fb_graph/searchable.rb +25 -0
  64. data/lib/fb_graph/searchable/result.rb +31 -0
  65. data/lib/fb_graph/status.rb +23 -0
  66. data/lib/fb_graph/subscription.rb +14 -0
  67. data/lib/fb_graph/tag.rb +16 -0
  68. data/lib/fb_graph/user.rb +89 -0
  69. data/lib/fb_graph/venue.rb +17 -0
  70. data/lib/fb_graph/video.rb +28 -0
  71. data/lib/fb_graph/work.rb +35 -0
  72. data/spec/fake_json/albums/photos/matake_private.json +97 -0
  73. data/spec/fake_json/albums/photos/post_with_valid_access_token.json +1 -0
  74. data/spec/fake_json/applications/subscriptions/fb_graph_private.json +12 -0
  75. data/spec/fake_json/checkins/search_private.json +54 -0
  76. data/spec/fake_json/checkins/search_public.json +6 -0
  77. data/spec/fake_json/events/attending/post_with_valid_access_token.json +1 -0
  78. data/spec/fake_json/events/attending/smartday_private.json +44 -0
  79. data/spec/fake_json/events/declined/post_with_valid_access_token.json +1 -0
  80. data/spec/fake_json/events/declined/smartday_private.json +720 -0
  81. data/spec/fake_json/events/invited/smartday_private.json +7092 -0
  82. data/spec/fake_json/events/maybe/post_with_valid_access_token.json +1 -0
  83. data/spec/fake_json/events/maybe/smartday_private.json +956 -0
  84. data/spec/fake_json/events/noreply/smartday_private.json +896 -0
  85. data/spec/fake_json/groups/members/emacs_private.json +1996 -0
  86. data/spec/fake_json/pages/checkins/gowalla_private.json +113 -0
  87. data/spec/fake_json/pages/checkins/gowalla_public.json +6 -0
  88. data/spec/fake_json/pages/notes/post_with_valid_access_token.json +1 -0
  89. data/spec/fake_json/pages/platform_private.json +13 -0
  90. data/spec/fake_json/pages/platform_public.json +13 -0
  91. data/spec/fake_json/pages/statuses/platform_private.json +258 -0
  92. data/spec/fake_json/pages/statuses/platform_public.json +6 -0
  93. data/spec/fake_json/posts/comments/post_with_invalid_access_token.json +1 -0
  94. data/spec/fake_json/posts/comments/post_with_valid_access_token.json +1 -0
  95. data/spec/fake_json/posts/comments/post_without_access_token.json +1 -0
  96. data/spec/fake_json/posts/likes/post_with_invalid_access_token.json +1 -0
  97. data/spec/fake_json/posts/likes/post_with_valid_access_token.json +1 -0
  98. data/spec/fake_json/posts/likes/post_without_access_token.json +1 -0
  99. data/spec/fake_json/posts/platform_private.json +97 -0
  100. data/spec/fake_json/posts/platform_public.json +52 -0
  101. data/spec/fake_json/users/accounts/matake_private.json +14 -0
  102. data/spec/fake_json/users/accounts/matake_private_with_manage_pages_permission.json +16 -0
  103. data/spec/fake_json/users/accounts/matake_public.json +6 -0
  104. data/spec/fake_json/users/activities/arjun_private.json +24 -0
  105. data/spec/fake_json/users/activities/arjun_public.json +6 -0
  106. data/spec/fake_json/users/albums/matake_private.json +36 -0
  107. data/spec/fake_json/users/albums/matake_public.json +6 -0
  108. data/spec/fake_json/users/albums/post_with_valid_access_token.json +1 -0
  109. data/spec/fake_json/users/arjun_private.json +109 -0
  110. data/spec/fake_json/users/arjun_public.json +12 -0
  111. data/spec/fake_json/users/books/matake_private.json +9 -0
  112. data/spec/fake_json/users/books/matake_public.json +6 -0
  113. data/spec/fake_json/users/checkins/mattt_private.json +389 -0
  114. data/spec/fake_json/users/checkins/mattt_public.json +6 -0
  115. data/spec/fake_json/users/events/matake_private.json +71 -0
  116. data/spec/fake_json/users/events/matake_public.json +6 -0
  117. data/spec/fake_json/users/events/post_with_valid_access_token.json +1 -0
  118. data/spec/fake_json/users/feed/arjun_private.json +520 -0
  119. data/spec/fake_json/users/feed/arjun_public.json +520 -0
  120. data/spec/fake_json/users/feed/post_with_invalid_access_token.json +1 -0
  121. data/spec/fake_json/users/feed/post_with_valid_access_token.json +1 -0
  122. data/spec/fake_json/users/feed/post_without_access_token.json +1 -0
  123. data/spec/fake_json/users/friends/arjun_private.json +6 -0
  124. data/spec/fake_json/users/friends/arjun_public.json +6 -0
  125. data/spec/fake_json/users/friends/me_private.json +524 -0
  126. data/spec/fake_json/users/friends/me_public.json +6 -0
  127. data/spec/fake_json/users/groups/matake_private.json +48 -0
  128. data/spec/fake_json/users/groups/matake_public.json +6 -0
  129. data/spec/fake_json/users/home/arjun_private.json +6 -0
  130. data/spec/fake_json/users/home/arjun_public.json +6 -0
  131. data/spec/fake_json/users/home/me_private.json +460 -0
  132. data/spec/fake_json/users/home/me_private_next.json +382 -0
  133. data/spec/fake_json/users/home/me_private_previous.json +36 -0
  134. data/spec/fake_json/users/home/me_public.json +6 -0
  135. data/spec/fake_json/users/interests/matake_private.json +14 -0
  136. data/spec/fake_json/users/likes/arjun_private.json +1394 -0
  137. data/spec/fake_json/users/likes/arjun_public.json +6 -0
  138. data/spec/fake_json/users/links/matake_private.json +221 -0
  139. data/spec/fake_json/users/links/post_with_valid_access_token.json +1 -0
  140. data/spec/fake_json/users/me_private.json +128 -0
  141. data/spec/fake_json/users/me_public.json +6 -0
  142. data/spec/fake_json/users/movies/matake_private.json +9 -0
  143. data/spec/fake_json/users/music/matake_private.json +34 -0
  144. data/spec/fake_json/users/notes/matake_private.json +308 -0
  145. data/spec/fake_json/users/posts/arjun_private.json +386 -0
  146. data/spec/fake_json/users/posts/arjun_public.json +386 -0
  147. data/spec/fake_json/users/statuses/arjun_private.json +233 -0
  148. data/spec/fake_json/users/statuses/arjun_public.json +6 -0
  149. data/spec/fake_json/users/tagged/arjun_private.json +308 -0
  150. data/spec/fake_json/users/tagged/arjun_public.json +308 -0
  151. data/spec/fake_json/users/television/matake_private.json +9 -0
  152. data/spec/fake_json/users/videos/kirk_private.json +41 -0
  153. data/spec/fb_graph/album_spec.rb +61 -0
  154. data/spec/fb_graph/application_spec.rb +23 -0
  155. data/spec/fb_graph/auth_spec.rb +35 -0
  156. data/spec/fb_graph/checkin_spec.rb +29 -0
  157. data/spec/fb_graph/collection_spec.rb +45 -0
  158. data/spec/fb_graph/comment_spec.rb +31 -0
  159. data/spec/fb_graph/connection_spec.rb +38 -0
  160. data/spec/fb_graph/connections/accounts_spec.rb +47 -0
  161. data/spec/fb_graph/connections/activities_spec.rb +34 -0
  162. data/spec/fb_graph/connections/albums_spec.rb +60 -0
  163. data/spec/fb_graph/connections/attending_spec.rb +24 -0
  164. data/spec/fb_graph/connections/books_spec.rb +33 -0
  165. data/spec/fb_graph/connections/checkins_spec.rb +109 -0
  166. data/spec/fb_graph/connections/comments_spec.rb +85 -0
  167. data/spec/fb_graph/connections/declined_spec.rb +24 -0
  168. data/spec/fb_graph/connections/events_spec.rb +53 -0
  169. data/spec/fb_graph/connections/feed_spec.rb +102 -0
  170. data/spec/fb_graph/connections/friends_spec.rb +50 -0
  171. data/spec/fb_graph/connections/groups_spec.rb +32 -0
  172. data/spec/fb_graph/connections/home_spec.rb +58 -0
  173. data/spec/fb_graph/connections/interests_spec.rb +14 -0
  174. data/spec/fb_graph/connections/invited_spec.rb +14 -0
  175. data/spec/fb_graph/connections/likes_spec.rb +33 -0
  176. data/spec/fb_graph/connections/links_spec.rb +33 -0
  177. data/spec/fb_graph/connections/maybe_spec.rb +24 -0
  178. data/spec/fb_graph/connections/members_spec.rb +14 -0
  179. data/spec/fb_graph/connections/movies_spec.rb +14 -0
  180. data/spec/fb_graph/connections/music_spec.rb +14 -0
  181. data/spec/fb_graph/connections/noreply_spec.rb +14 -0
  182. data/spec/fb_graph/connections/notes_spec.rb +32 -0
  183. data/spec/fb_graph/connections/photos_spec.rb +30 -0
  184. data/spec/fb_graph/connections/picture_spec.rb +29 -0
  185. data/spec/fb_graph/connections/posts_spec.rb +35 -0
  186. data/spec/fb_graph/connections/statuses_spec.rb +74 -0
  187. data/spec/fb_graph/connections/subscriptions_spec.rb +18 -0
  188. data/spec/fb_graph/connections/tagged_spec.rb +42 -0
  189. data/spec/fb_graph/connections/television_spec.rb +14 -0
  190. data/spec/fb_graph/connections/videos_spec.rb +14 -0
  191. data/spec/fb_graph/education_spec.rb +61 -0
  192. data/spec/fb_graph/event_spec.rb +50 -0
  193. data/spec/fb_graph/group_spec.rb +46 -0
  194. data/spec/fb_graph/insight_spec.rb +17 -0
  195. data/spec/fb_graph/link_spec.rb +43 -0
  196. data/spec/fb_graph/node_spec.rb +13 -0
  197. data/spec/fb_graph/note_spec.rb +37 -0
  198. data/spec/fb_graph/page_spec.rb +56 -0
  199. data/spec/fb_graph/photo_spec.rb +60 -0
  200. data/spec/fb_graph/post_spec.rb +71 -0
  201. data/spec/fb_graph/status_spec.rb +31 -0
  202. data/spec/fb_graph/subscription_spec.rb +5 -0
  203. data/spec/fb_graph/tag_spec.rb +20 -0
  204. data/spec/fb_graph/user_spec.rb +139 -0
  205. data/spec/fb_graph/venue_spec.rb +23 -0
  206. data/spec/fb_graph/video_spec.rb +37 -0
  207. data/spec/fb_graph/work_spec.rb +67 -0
  208. data/spec/helpers/fake_json_helper.rb +11 -0
  209. data/spec/spec.opts +3 -0
  210. data/spec/spec_helper.rb +18 -0
  211. metadata +414 -0
@@ -0,0 +1,308 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "id": "7901103_117809521578252",
5
+ "from": {
6
+ "name": "Elli Mooney",
7
+ "id": "1404401889"
8
+ },
9
+ "to": {
10
+ "data": [
11
+ {
12
+ "name": "Arjun Banker",
13
+ "id": "7901103"
14
+ }
15
+ ]
16
+ },
17
+ "message": "...uh oh, here comes a privacy issue....",
18
+ "picture": "http://external.ak.fbcdn.net/safe_image.php?d=c659c86d415c60c37b2871bfd67f2a97&w=130&h=130&url=http%3A%2F%2Fcdn.venturebeat.com%2Fwp-content%2Fuploads%2F2010%2F04%2Fusethisone.jpg",
19
+ "link": "http://venturebeat.com/2010/04/23/blippy-credit-card-citibank/",
20
+ "name": "Blippy users\u2019 credit card numbers found on Google | VentureBeat",
21
+ "caption": "venturebeat.com",
22
+ "description": "[Update: Blippy cofounder Philip Kaplan emailed a response. CNET News is reporting that the cards in question were issued by ...",
23
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif",
24
+ "privacy": {
25
+ "value": "EVERYONE"
26
+ },
27
+ "created_time": "2010-04-24T08:07:59+0000",
28
+ "updated_time": "2010-04-24T08:07:59+0000",
29
+ "likes": 1
30
+ },
31
+ {
32
+ "id": "7901103_10100207879175340",
33
+ "from": {
34
+ "name": "Andrew 'Boz' Bosworth",
35
+ "id": "1681"
36
+ },
37
+ "to": {
38
+ "data": [
39
+ {
40
+ "name": "Arjun Banker",
41
+ "id": "7901103"
42
+ }
43
+ ]
44
+ },
45
+ "picture": "http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs461.snc3/25356_721202242761_1681_39052168_1554343_s.jpg",
46
+ "link": "http://www.facebook.com/photo.php?pid=39052168&id=1681",
47
+ "name": "f8 2010",
48
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif",
49
+ "privacy": {
50
+ "value": "EVERYONE"
51
+ },
52
+ "created_time": "2010-04-22T08:24:26+0000",
53
+ "updated_time": "2010-04-22T08:24:26+0000"
54
+ },
55
+ {
56
+ "id": "7901103_10100207803551890",
57
+ "from": {
58
+ "name": "Steve Blackmon",
59
+ "id": "687664828"
60
+ },
61
+ "to": {
62
+ "data": [
63
+ {
64
+ "name": "Arjun Banker",
65
+ "id": "7901103"
66
+ }
67
+ ]
68
+ },
69
+ "message": "Facebook opengraph and new API terms of service are huge improvement, nice work. Participate in defining and adopt a w3c RDF standard for these concepts and facebook will have a prominent place in #linkeddata history.",
70
+ "icon": "http://graph.facebook.com/images/icons/mobile_app.gif",
71
+ "attribution": "Facebook for iPhone",
72
+ "privacy": {
73
+ "value": "EVERYONE"
74
+ },
75
+ "created_time": "2010-04-22T04:52:11+0000",
76
+ "updated_time": "2010-04-22T04:52:11+0000"
77
+ },
78
+ {
79
+ "id": "7901103_10100207635533600",
80
+ "from": {
81
+ "name": "Aditya Bansod",
82
+ "id": "3325854"
83
+ },
84
+ "to": {
85
+ "data": [
86
+ {
87
+ "name": "Arjun Banker",
88
+ "id": "7901103"
89
+ }
90
+ ]
91
+ },
92
+ "message": "dude, you're internet famous!",
93
+ "privacy": {
94
+ "value": "EVERYONE"
95
+ },
96
+ "created_time": "2010-04-22T01:34:11+0000",
97
+ "updated_time": "2010-04-22T01:34:11+0000"
98
+ },
99
+ {
100
+ "id": "7901103_10100207523223670",
101
+ "from": {
102
+ "name": "Waleed Abdulla",
103
+ "id": "500071393"
104
+ },
105
+ "to": {
106
+ "data": [
107
+ {
108
+ "name": "Arjun Banker",
109
+ "id": "7901103"
110
+ }
111
+ ]
112
+ },
113
+ "message": "Great job on stage today. I'm so excited right now :)",
114
+ "privacy": {
115
+ "value": "EVERYONE"
116
+ },
117
+ "created_time": "2010-04-21T22:24:54+0000",
118
+ "updated_time": "2010-04-21T22:24:54+0000"
119
+ },
120
+ {
121
+ "id": "7901103_10100207519022090",
122
+ "from": {
123
+ "name": "Atish Mehta",
124
+ "id": "3404106"
125
+ },
126
+ "to": {
127
+ "data": [
128
+ {
129
+ "name": "Arjun Banker",
130
+ "id": "7901103"
131
+ }
132
+ ]
133
+ },
134
+ "message": "The kids are happy\n\nhttp://news.ycombinator.com/item?id=1282860",
135
+ "privacy": {
136
+ "value": "EVERYONE"
137
+ },
138
+ "created_time": "2010-04-21T22:19:08+0000",
139
+ "updated_time": "2010-04-21T22:19:08+0000"
140
+ },
141
+ {
142
+ "id": "7901103_10100207509825520",
143
+ "from": {
144
+ "name": "John Allen",
145
+ "id": "400586"
146
+ },
147
+ "to": {
148
+ "data": [
149
+ {
150
+ "name": "Arjun Banker",
151
+ "id": "7901103"
152
+ }
153
+ ]
154
+ },
155
+ "message": "I can see you...",
156
+ "privacy": {
157
+ "value": "EVERYONE"
158
+ },
159
+ "created_time": "2010-04-21T22:03:50+0000",
160
+ "updated_time": "2010-04-21T22:03:50+0000"
161
+ },
162
+ {
163
+ "id": "7901103_10100207507125930",
164
+ "from": {
165
+ "name": "Joseph Sofaer",
166
+ "id": "820004"
167
+ },
168
+ "to": {
169
+ "data": [
170
+ {
171
+ "name": "Arjun Banker",
172
+ "id": "7901103"
173
+ }
174
+ ]
175
+ },
176
+ "message": "The new Graph API looks great!",
177
+ "privacy": {
178
+ "value": "EVERYONE"
179
+ },
180
+ "created_time": "2010-04-21T21:59:18+0000",
181
+ "updated_time": "2010-04-21T21:59:18+0000"
182
+ },
183
+ {
184
+ "id": "7901103_10100207467265810",
185
+ "from": {
186
+ "name": "Kovas Boguta",
187
+ "id": "2903108"
188
+ },
189
+ "to": {
190
+ "data": [
191
+ {
192
+ "name": "Arjun Banker",
193
+ "id": "7901103"
194
+ }
195
+ ]
196
+ },
197
+ "message": "Nice work, this is awesome!!",
198
+ "privacy": {
199
+ "value": "EVERYONE"
200
+ },
201
+ "created_time": "2010-04-21T20:49:18+0000",
202
+ "updated_time": "2010-04-21T20:49:18+0000"
203
+ },
204
+ {
205
+ "id": "7901103_672772511333",
206
+ "from": {
207
+ "name": "Mark Slee",
208
+ "id": "204686"
209
+ },
210
+ "to": {
211
+ "data": [
212
+ {
213
+ "name": "Arjun Banker",
214
+ "id": "7901103"
215
+ }
216
+ ]
217
+ },
218
+ "message": "Holy graph-ballz, Batman!",
219
+ "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs405.snc3/24521_672772511333_204686_37732593_3662199_s.jpg",
220
+ "link": "http://www.facebook.com/photo.php?pid=37732593&id=204686",
221
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif",
222
+ "privacy": {
223
+ "value": "EVERYONE"
224
+ },
225
+ "created_time": "2010-04-21T18:00:23+0000",
226
+ "updated_time": "2010-04-21T18:00:23+0000",
227
+ "likes": 3
228
+ },
229
+ {
230
+ "id": "7901103_113242142040451",
231
+ "from": {
232
+ "name": "Tom Lianza",
233
+ "id": "4810243"
234
+ },
235
+ "to": {
236
+ "data": [
237
+ {
238
+ "name": "Arjun Banker",
239
+ "id": "7901103"
240
+ }
241
+ ]
242
+ },
243
+ "message": "Ha! I've seen your name more than once in the new API docs: http://developers.facebook.com/docs/reference/api/user",
244
+ "name": "User - Facebook Developers",
245
+ "caption": "developers.facebook.com",
246
+ "description": "The photos, videos, and posts in which this user has been tagged. Requires the user_photo_tags, user_video_tags, friend_photo_tags, or friend_video_tags permissions",
247
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif",
248
+ "privacy": {
249
+ "value": "EVERYONE"
250
+ },
251
+ "created_time": "2010-04-21T17:55:50+0000",
252
+ "updated_time": "2010-04-21T20:22:56+0000",
253
+ "likes": 1,
254
+ "comments": {
255
+ "data": [
256
+ {
257
+ "id": "7901103_113242142040451_316099",
258
+ "from": {
259
+ "name": "Arjun Banker",
260
+ "id": "7901103"
261
+ },
262
+ "message": "what are you doing reading the docs? hit that endpoint straight up.",
263
+ "created_time": "2010-04-21T19:22:26+0000"
264
+ },
265
+ {
266
+ "id": "7901103_113242142040451_316657",
267
+ "from": {
268
+ "name": "Tom Lianza",
269
+ "id": "4810243"
270
+ },
271
+ "message": "I was going to quickly add this sweet \"like\" button until I realized that meant moving to the new connect libraries, in which it seems the syntax has changed and a bunch of code has to be rewritten, but after I do that, I'll just hit things straight up :P",
272
+ "created_time": "2010-04-21T20:22:56+0000"
273
+ }
274
+ ]
275
+ }
276
+ },
277
+ {
278
+ "id": "7901103_116468971706246",
279
+ "from": {
280
+ "name": "Blaise DiPersia",
281
+ "id": "1319289"
282
+ },
283
+ "to": {
284
+ "data": [
285
+ {
286
+ "name": "Arjun Banker",
287
+ "id": "7901103"
288
+ }
289
+ ]
290
+ },
291
+ "picture": "http://external.ak.fbcdn.net/safe_image.php?d=ad661523774a2045aad1ebf469f99dd5&w=130&h=130&url=http%3A%2F%2Fwww.blanka.co.uk%2Fi%2Fproducts%2F2708.jpg",
292
+ "link": "http://www.blanka.co.uk/supersize?product=2708",
293
+ "name": "Blanka || Supersize",
294
+ "caption": "www.blanka.co.uk",
295
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif",
296
+ "privacy": {
297
+ "value": "EVERYONE"
298
+ },
299
+ "created_time": "2010-04-21T07:55:49+0000",
300
+ "updated_time": "2010-04-21T07:55:49+0000",
301
+ "likes": 1
302
+ }
303
+ ],
304
+ "paging": {
305
+ "previous": "https://graph.facebook.com/7901103/tagged?limit=25&since=2010-04-24T08%3A07%3A59%2B0000",
306
+ "next": "https://graph.facebook.com/7901103/tagged?limit=25&until=2010-04-21T07%3A55%3A49%2B0000"
307
+ }
308
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "name": "Mechaike",
5
+ "category": "Tv show",
6
+ "id": "112290805463702"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "id": "710941036305",
5
+ "from": {
6
+ "name": "Gee Chuang",
7
+ "id": "428746"
8
+ },
9
+ "tags": {
10
+ "data": [
11
+ {
12
+ "id": "556473203",
13
+ "name": "Andrew Plummer",
14
+ "created_time": "2009-10-23T06:54:57+0000"
15
+ },
16
+ {
17
+ "id": "4810308",
18
+ "name": "Mattt Thompson",
19
+ "created_time": "2009-10-23T06:54:56+0000"
20
+ },
21
+ {
22
+ "id": "428746",
23
+ "name": "Gee Chuang",
24
+ "created_time": "2009-10-23T06:54:56+0000"
25
+ },
26
+ {
27
+ "id": "6401",
28
+ "name": "Kirk McMurray",
29
+ "created_time": "2009-10-23T06:54:56+0000"
30
+ }
31
+ ]
32
+ },
33
+ "name": "Last bite of the Windows 7 Whopper",
34
+ "picture": "http://vthumb.ak.fbcdn.net/vthumb-ak-sf2p/v10827/183/21/428746/t428746_710941036305_17487.jpg",
35
+ "embed_html": "<object width=\"576\" height=\"432\" ><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://www.facebook.com/v/710941036305\" /><embed src=\"http://www.facebook.com/v/710941036305\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"576\" height=\"432\"></embed></object>",
36
+ "icon": "http://static.ak.fbcdn.net/rsrc.php/z75M0/hash/6z01mawk.gif",
37
+ "created_time": "2009-10-23T06:52:44+0000",
38
+ "updated_time": "2009-10-23T06:52:44+0000"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,61 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Album, '.new' do
4
+
5
+ it 'should setup all supported attributes' do
6
+ attributes = {
7
+ :id => '12345',
8
+ :from => {
9
+ :id => '23456',
10
+ :name => 'nov matake'
11
+ },
12
+ :name => 'album 1',
13
+ :description => 'an album for fb_graph test',
14
+ :location => 'Tokyo, Japan',
15
+ :link => 'http://www.facebook.com/album/12345',
16
+ :count => 10,
17
+ :created_time => '2009-12-29T15:24:50+0000',
18
+ :updated_time => '2010-01-02T15:37:41+0000',
19
+ :comments => {
20
+ :data => [{
21
+ :id => '909694472945_418735',
22
+ :from => {
23
+ :id => '520739622',
24
+ :name => 'Alison Marie Weber',
25
+ },
26
+ :message => 'Love all the pix!',
27
+ :created_time => '2009-08-15T14:57:36+0000'
28
+ }]
29
+ }
30
+ }
31
+ album = FbGraph::Album.new(attributes.delete(:id), attributes)
32
+ album.identifier.should == '12345'
33
+ album.from.should == FbGraph::User.new('23456', :name => 'nov matake')
34
+ album.name.should == 'album 1'
35
+ album.description.should == 'an album for fb_graph test'
36
+ album.location.should == 'Tokyo, Japan'
37
+ album.link.should == 'http://www.facebook.com/album/12345'
38
+ album.count.should == 10
39
+ album.created_time.should == Time.parse('2009-12-29T15:24:50+0000')
40
+ album.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
41
+ album.comments.should == [FbGraph::Comment.new(
42
+ '909694472945_418735',
43
+ :from => {
44
+ :id => '520739622',
45
+ :name => 'Alison Marie Weber',
46
+ },
47
+ :message => 'Love all the pix!',
48
+ :created_time => '2009-08-15T14:57:36+0000'
49
+ )]
50
+ end
51
+
52
+ it 'should support page as from' do
53
+ page_album = FbGraph::Album.new('12345', :from => {
54
+ :id => '23456',
55
+ :name => 'Smart.fm',
56
+ :category => 'Web Site'
57
+ })
58
+ page_album.from.should == FbGraph::Page.new('23456', :name => 'Smart.fm', :category => 'Web Site')
59
+ end
60
+
61
+ end
@@ -0,0 +1,23 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Application, '.new' do
4
+
5
+ it 'should setup all supported attributes' do
6
+ attributes = {
7
+ :id => '12345',
8
+ :name => 'FbGraph',
9
+ :description => 'Owsome Facebook Graph Wrapper',
10
+ :category => 'Programming',
11
+ :link => 'http://github.com/nov/fb_graph',
12
+ :secret => 'sec sec'
13
+ }
14
+ app = FbGraph::Application.new(attributes.delete(:id), attributes)
15
+ app.identifier.should == '12345'
16
+ app.name.should == 'FbGraph'
17
+ app.description.should == 'Owsome Facebook Graph Wrapper'
18
+ app.category.should == 'Programming'
19
+ app.link.should == 'http://github.com/nov/fb_graph'
20
+ app.secret.should == 'sec sec'
21
+ end
22
+
23
+ end
@@ -0,0 +1,35 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Auth, '.new' do
4
+
5
+ it 'should setup OAuth2::Client' do
6
+ auth = FbGraph::Auth.new('client_id', 'client_secret')
7
+ auth.client.should be_a(OAuth2::Client)
8
+ auth.client.id.should == 'client_id'
9
+ auth.client.secret.should == 'client_secret'
10
+ end
11
+
12
+ context 'when invalid cookie given' do
13
+ it 'should raise FbGraph::VerificationFailed' do
14
+ lambda do
15
+ FbGraph::Auth.new('client_id', 'client_secret', :cookie => 'invalid')
16
+ end.should raise_exception(FbGraph::Auth::VerificationFailed)
17
+ end
18
+ end
19
+
20
+ end
21
+
22
+ describe FbGraph::Auth, '.from_cookie' do
23
+ before do
24
+ @auth = FbGraph::Auth.new('client_id', 'client_secret')
25
+ end
26
+
27
+ context 'when invalid cookie given' do
28
+ it 'should raise FbGraph::VerificationFailed' do
29
+ lambda do
30
+ @auth.from_cookie('invalid')
31
+ end.should raise_exception(FbGraph::Auth::VerificationFailed)
32
+ end
33
+ end
34
+
35
+ end