gs_graph 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitattributes +22 -0
- data/.gitignore +26 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +95 -0
- data/LICENSE +20 -0
- data/README.rdoc +314 -0
- data/Rakefile +25 -0
- data/VERSION +1 -0
- data/assets/fb_graph.ai +1726 -6
- data/assets/fb_graph.png +0 -0
- data/gs_graph.gemspec +28 -0
- data/lib/gs_graph.rb +174 -0
- data/lib/gs_graph/achievement.rb +44 -0
- data/lib/gs_graph/action.rb +12 -0
- data/lib/gs_graph/ad_account.rb +51 -0
- data/lib/gs_graph/ad_campaign.rb +39 -0
- data/lib/gs_graph/ad_campaign_stat.rb +22 -0
- data/lib/gs_graph/ad_connection_object.rb +53 -0
- data/lib/gs_graph/ad_creative.rb +44 -0
- data/lib/gs_graph/ad_group.rb +51 -0
- data/lib/gs_graph/ad_group_stat.rb +22 -0
- data/lib/gs_graph/ad_keyword.rb +20 -0
- data/lib/gs_graph/ad_keyword_suggestion.rb +8 -0
- data/lib/gs_graph/ad_keyword_valid.rb +23 -0
- data/lib/gs_graph/ad_preview.rb +10 -0
- data/lib/gs_graph/ad_user.rb +58 -0
- data/lib/gs_graph/age_range.rb +12 -0
- data/lib/gs_graph/album.rb +59 -0
- data/lib/gs_graph/app_request.rb +24 -0
- data/lib/gs_graph/application.rb +119 -0
- data/lib/gs_graph/auth.rb +88 -0
- data/lib/gs_graph/auth/cookie.rb +20 -0
- data/lib/gs_graph/auth/signed_request.rb +44 -0
- data/lib/gs_graph/broad_targeting_category.rb +13 -0
- data/lib/gs_graph/checkin.rb +51 -0
- data/lib/gs_graph/collection.rb +55 -0
- data/lib/gs_graph/comment.rb +24 -0
- data/lib/gs_graph/comparison.rb +13 -0
- data/lib/gs_graph/connection.rb +37 -0
- data/lib/gs_graph/connections.rb +3 -0
- data/lib/gs_graph/connections/accounts.rb +23 -0
- data/lib/gs_graph/connections/achievements.rb +21 -0
- data/lib/gs_graph/connections/activities.rb +14 -0
- data/lib/gs_graph/connections/ad_accounts.rb +15 -0
- data/lib/gs_graph/connections/ad_campaign_stats.rb +22 -0
- data/lib/gs_graph/connections/ad_campaigns.rb +30 -0
- data/lib/gs_graph/connections/ad_connection_objects.rb +14 -0
- data/lib/gs_graph/connections/ad_creatives.rb +14 -0
- data/lib/gs_graph/connections/ad_group_stats.rb +22 -0
- data/lib/gs_graph/connections/ad_groups.rb +35 -0
- data/lib/gs_graph/connections/ad_previews.rb +10 -0
- data/lib/gs_graph/connections/admins.rb +10 -0
- data/lib/gs_graph/connections/albums.rb +21 -0
- data/lib/gs_graph/connections/app_notifications.rb +10 -0
- data/lib/gs_graph/connections/app_requests.rb +21 -0
- data/lib/gs_graph/connections/attending.rb +26 -0
- data/lib/gs_graph/connections/banned.rb +31 -0
- data/lib/gs_graph/connections/blocked.rb +36 -0
- data/lib/gs_graph/connections/books.rb +14 -0
- data/lib/gs_graph/connections/broad_targeting_categories.rb +14 -0
- data/lib/gs_graph/connections/checkins.rb +21 -0
- data/lib/gs_graph/connections/comments.rb +21 -0
- data/lib/gs_graph/connections/conversations.rb +14 -0
- data/lib/gs_graph/connections/declined.rb +25 -0
- data/lib/gs_graph/connections/docs.rb +14 -0
- data/lib/gs_graph/connections/events.rb +21 -0
- data/lib/gs_graph/connections/family.rb +14 -0
- data/lib/gs_graph/connections/feed.rb +21 -0
- data/lib/gs_graph/connections/former_participants.rb +14 -0
- data/lib/gs_graph/connections/friend_lists.rb +21 -0
- data/lib/gs_graph/connections/friend_requests.rb +12 -0
- data/lib/gs_graph/connections/friends.rb +14 -0
- data/lib/gs_graph/connections/games.rb +14 -0
- data/lib/gs_graph/connections/groups.rb +14 -0
- data/lib/gs_graph/connections/home.rb +14 -0
- data/lib/gs_graph/connections/inbox.rb +20 -0
- data/lib/gs_graph/connections/insights.rb +27 -0
- data/lib/gs_graph/connections/interests.rb +14 -0
- data/lib/gs_graph/connections/invited.rb +36 -0
- data/lib/gs_graph/connections/likes.rb +29 -0
- data/lib/gs_graph/connections/links.rb +21 -0
- data/lib/gs_graph/connections/maybe.rb +25 -0
- data/lib/gs_graph/connections/members.rb +22 -0
- data/lib/gs_graph/connections/messages.rb +22 -0
- data/lib/gs_graph/connections/milestones.rb +21 -0
- data/lib/gs_graph/connections/movies.rb +14 -0
- data/lib/gs_graph/connections/music.rb +14 -0
- data/lib/gs_graph/connections/mutual_friends.rb +26 -0
- data/lib/gs_graph/connections/noreply.rb +23 -0
- data/lib/gs_graph/connections/notes.rb +21 -0
- data/lib/gs_graph/connections/notifications.rb +18 -0
- data/lib/gs_graph/connections/offers.rb +22 -0
- data/lib/gs_graph/connections/outbox.rb +20 -0
- data/lib/gs_graph/connections/participants.rb +14 -0
- data/lib/gs_graph/connections/payments.rb +14 -0
- data/lib/gs_graph/connections/permissions.rb +16 -0
- data/lib/gs_graph/connections/photos.rb +21 -0
- data/lib/gs_graph/connections/picture.rb +39 -0
- data/lib/gs_graph/connections/pokes.rb +12 -0
- data/lib/gs_graph/connections/posts.rb +14 -0
- data/lib/gs_graph/connections/promotable_posts.rb +14 -0
- data/lib/gs_graph/connections/question_options.rb +14 -0
- data/lib/gs_graph/connections/questions.rb +22 -0
- data/lib/gs_graph/connections/reach_estimates.rb +12 -0
- data/lib/gs_graph/connections/roles.rb +36 -0
- data/lib/gs_graph/connections/scores.rb +22 -0
- data/lib/gs_graph/connections/senders.rb +14 -0
- data/lib/gs_graph/connections/settings.rb +65 -0
- data/lib/gs_graph/connections/statuses.rb +14 -0
- data/lib/gs_graph/connections/subscribed_to.rb +14 -0
- data/lib/gs_graph/connections/subscribers.rb +14 -0
- data/lib/gs_graph/connections/subscriptions.rb +53 -0
- data/lib/gs_graph/connections/tabs.rb +23 -0
- data/lib/gs_graph/connections/tagged.rb +14 -0
- data/lib/gs_graph/connections/tags.rb +23 -0
- data/lib/gs_graph/connections/television.rb +14 -0
- data/lib/gs_graph/connections/test_users.rb +19 -0
- data/lib/gs_graph/connections/threads.rb +14 -0
- data/lib/gs_graph/connections/user_achievements.rb +22 -0
- data/lib/gs_graph/connections/user_likes.rb +19 -0
- data/lib/gs_graph/connections/videos.rb +21 -0
- data/lib/gs_graph/connections/votes.rb +9 -0
- data/lib/gs_graph/cover.rb +10 -0
- data/lib/gs_graph/debugger.rb +28 -0
- data/lib/gs_graph/device.rb +11 -0
- data/lib/gs_graph/doc.rb +18 -0
- data/lib/gs_graph/domain.rb +32 -0
- data/lib/gs_graph/education.rb +32 -0
- data/lib/gs_graph/event.rb +52 -0
- data/lib/gs_graph/exception.rb +139 -0
- data/lib/gs_graph/friend_list.rb +13 -0
- data/lib/gs_graph/friend_request.rb +14 -0
- data/lib/gs_graph/group.rb +29 -0
- data/lib/gs_graph/image.rb +11 -0
- data/lib/gs_graph/insight.rb +13 -0
- data/lib/gs_graph/klass.rb +31 -0
- data/lib/gs_graph/link.rb +32 -0
- data/lib/gs_graph/location.rb +20 -0
- data/lib/gs_graph/message.rb +30 -0
- data/lib/gs_graph/milestone.rb +26 -0
- data/lib/gs_graph/node.rb +149 -0
- data/lib/gs_graph/note.rb +32 -0
- data/lib/gs_graph/notification.rb +32 -0
- data/lib/gs_graph/offer.rb +33 -0
- data/lib/gs_graph/open_graph.rb +3 -0
- data/lib/gs_graph/open_graph/action.rb +42 -0
- data/lib/gs_graph/open_graph/application_context.rb +10 -0
- data/lib/gs_graph/open_graph/object.rb +29 -0
- data/lib/gs_graph/open_graph/user_context.rb +21 -0
- data/lib/gs_graph/order.rb +55 -0
- data/lib/gs_graph/page.rb +57 -0
- data/lib/gs_graph/page/category_attributes.rb +117 -0
- data/lib/gs_graph/photo.rb +48 -0
- data/lib/gs_graph/picture.rb +14 -0
- data/lib/gs_graph/place.rb +7 -0
- data/lib/gs_graph/poke.rb +19 -0
- data/lib/gs_graph/post.rb +117 -0
- data/lib/gs_graph/privacy.rb +27 -0
- data/lib/gs_graph/project.rb +4 -0
- data/lib/gs_graph/promotable_post.rb +34 -0
- data/lib/gs_graph/property.rb +13 -0
- data/lib/gs_graph/query.rb +47 -0
- data/lib/gs_graph/question.rb +26 -0
- data/lib/gs_graph/question_option.rb +22 -0
- data/lib/gs_graph/reach_estimate.rb +22 -0
- data/lib/gs_graph/role.rb +13 -0
- data/lib/gs_graph/score.rb +16 -0
- data/lib/gs_graph/searchable.rb +33 -0
- data/lib/gs_graph/searchable/result.rb +31 -0
- data/lib/gs_graph/serialization.rb +19 -0
- data/lib/gs_graph/status.rb +27 -0
- data/lib/gs_graph/subscription.rb +14 -0
- data/lib/gs_graph/tab.rb +17 -0
- data/lib/gs_graph/tag.rb +30 -0
- data/lib/gs_graph/tagged_object.rb +23 -0
- data/lib/gs_graph/targeting.rb +23 -0
- data/lib/gs_graph/test_user.rb +24 -0
- data/lib/gs_graph/thread.rb +71 -0
- data/lib/gs_graph/user.rb +153 -0
- data/lib/gs_graph/user_achievement.rb +35 -0
- data/lib/gs_graph/venue.rb +14 -0
- data/lib/gs_graph/video.rb +41 -0
- data/lib/gs_graph/work.rb +48 -0
- data/lib/patch/rack/oauth2/access_token.rb +11 -0
- data/lib/patch/rack/oauth2/access_token/introspectable.rb +37 -0
- data/lib/patch/rack/oauth2/client.rb +13 -0
- data/lib/patch/rack/oauth2/grant/fb_exchange_token.rb +11 -0
- data/lib/patch/rack/oauth2/util.rb +14 -0
- data/spec/gs_graph/achievement_spec.rb +59 -0
- data/spec/gs_graph/ad_account_spec.rb +124 -0
- data/spec/gs_graph/ad_campaign_spec.rb +99 -0
- data/spec/gs_graph/ad_connection_object_spec.rb +71 -0
- data/spec/gs_graph/ad_creative_spec.rb +87 -0
- data/spec/gs_graph/ad_group_spec.rb +95 -0
- data/spec/gs_graph/ad_keyword_spec.rb +27 -0
- data/spec/gs_graph/ad_keyword_suggestion_spec.rb +17 -0
- data/spec/gs_graph/ad_keyword_valid_spec.rb +19 -0
- data/spec/gs_graph/ad_user_spec.rb +67 -0
- data/spec/gs_graph/album_spec.rb +93 -0
- data/spec/gs_graph/app_request_spec.rb +40 -0
- data/spec/gs_graph/application_spec.rb +251 -0
- data/spec/gs_graph/auth/cookie_spec.rb +29 -0
- data/spec/gs_graph/auth/signed_request_spec.rb +22 -0
- data/spec/gs_graph/auth_spec.rb +223 -0
- data/spec/gs_graph/broad_targeting_category_spec.rb +17 -0
- data/spec/gs_graph/checkin_spec.rb +42 -0
- data/spec/gs_graph/collection_spec.rb +50 -0
- data/spec/gs_graph/comment_spec.rb +31 -0
- data/spec/gs_graph/connection_spec.rb +42 -0
- data/spec/gs_graph/connections/accounts_spec.rb +78 -0
- data/spec/gs_graph/connections/achievements_spec.rb +27 -0
- data/spec/gs_graph/connections/activities_spec.rb +34 -0
- data/spec/gs_graph/connections/ad_accounts_spec.rb +28 -0
- data/spec/gs_graph/connections/ad_campaign_stat_spec.rb +35 -0
- data/spec/gs_graph/connections/ad_campaigns_spec.rb +36 -0
- data/spec/gs_graph/connections/ad_connection_objects_spec.rb +20 -0
- data/spec/gs_graph/connections/ad_creatives_spec.rb +29 -0
- data/spec/gs_graph/connections/ad_group_stat_spec.rb +54 -0
- data/spec/gs_graph/connections/ad_groups_spec.rb +92 -0
- data/spec/gs_graph/connections/ad_previews_spec.rb +18 -0
- data/spec/gs_graph/connections/admins_spec.rb +20 -0
- data/spec/gs_graph/connections/albums_spec.rb +63 -0
- data/spec/gs_graph/connections/app_notifications_spec.rb +23 -0
- data/spec/gs_graph/connections/app_requests_spec.rb +28 -0
- data/spec/gs_graph/connections/attending_spec.rb +47 -0
- data/spec/gs_graph/connections/banned_spec.rb +63 -0
- data/spec/gs_graph/connections/blocked_spec.rb +56 -0
- data/spec/gs_graph/connections/books_spec.rb +32 -0
- data/spec/gs_graph/connections/broad_targeting_categories_spec.rb +18 -0
- data/spec/gs_graph/connections/checkins_spec.rb +153 -0
- data/spec/gs_graph/connections/comments_spec.rb +75 -0
- data/spec/gs_graph/connections/conversations_spec.rb +19 -0
- data/spec/gs_graph/connections/declined_spec.rb +47 -0
- data/spec/gs_graph/connections/docs_spec.rb +14 -0
- data/spec/gs_graph/connections/events_spec.rb +52 -0
- data/spec/gs_graph/connections/family_spec.rb +32 -0
- data/spec/gs_graph/connections/feed_spec.rb +124 -0
- data/spec/gs_graph/connections/former_participants_spec.rb +44 -0
- data/spec/gs_graph/connections/friend_lists_spec.rb +26 -0
- data/spec/gs_graph/connections/friend_requests_spec.rb +16 -0
- data/spec/gs_graph/connections/friends_spec.rb +51 -0
- data/spec/gs_graph/connections/games_spec.rb +20 -0
- data/spec/gs_graph/connections/groups_spec.rb +31 -0
- data/spec/gs_graph/connections/home_spec.rb +62 -0
- data/spec/gs_graph/connections/inbox_spec.rb +16 -0
- data/spec/gs_graph/connections/insights_spec.rb +104 -0
- data/spec/gs_graph/connections/interests_spec.rb +12 -0
- data/spec/gs_graph/connections/invited_spec.rb +84 -0
- data/spec/gs_graph/connections/likes_spec.rb +127 -0
- data/spec/gs_graph/connections/links_spec.rb +31 -0
- data/spec/gs_graph/connections/maybe_spec.rb +47 -0
- data/spec/gs_graph/connections/members_spec.rb +57 -0
- data/spec/gs_graph/connections/messages_spec.rb +58 -0
- data/spec/gs_graph/connections/milestones_spec.rb +40 -0
- data/spec/gs_graph/connections/movies_spec.rb +12 -0
- data/spec/gs_graph/connections/music_spec.rb +12 -0
- data/spec/gs_graph/connections/mutual_friends_spec.rb +28 -0
- data/spec/gs_graph/connections/noreply_spec.rb +39 -0
- data/spec/gs_graph/connections/notes_spec.rb +31 -0
- data/spec/gs_graph/connections/notifications_spec.rb +30 -0
- data/spec/gs_graph/connections/outbox_spec.rb +16 -0
- data/spec/gs_graph/connections/participants_spec.rb +42 -0
- data/spec/gs_graph/connections/payments_spec.rb +17 -0
- data/spec/gs_graph/connections/permissions_spec.rb +44 -0
- data/spec/gs_graph/connections/photos_spec.rb +39 -0
- data/spec/gs_graph/connections/picture_spec.rb +92 -0
- data/spec/gs_graph/connections/pokes_spec.rb +16 -0
- data/spec/gs_graph/connections/posts_spec.rb +34 -0
- data/spec/gs_graph/connections/promotable_posts_spec.rb +24 -0
- data/spec/gs_graph/connections/question_options_spec.rb +14 -0
- data/spec/gs_graph/connections/questions_spec.rb +31 -0
- data/spec/gs_graph/connections/reach_estimates_spec.rb +18 -0
- data/spec/gs_graph/connections/roles_spec.rb +59 -0
- data/spec/gs_graph/connections/scores_spec.rb +40 -0
- data/spec/gs_graph/connections/senders_spec.rb +42 -0
- data/spec/gs_graph/connections/settings_spec.rb +62 -0
- data/spec/gs_graph/connections/statuses_spec.rb +72 -0
- data/spec/gs_graph/connections/subscribed_to_spec.rb +12 -0
- data/spec/gs_graph/connections/subscribers_spec.rb +12 -0
- data/spec/gs_graph/connections/subscriptions_spec.rb +47 -0
- data/spec/gs_graph/connections/tabs_spec.rb +47 -0
- data/spec/gs_graph/connections/tagged_spec.rb +42 -0
- data/spec/gs_graph/connections/tags_spec.rb +30 -0
- data/spec/gs_graph/connections/television_spec.rb +12 -0
- data/spec/gs_graph/connections/test_users_spec.rb +65 -0
- data/spec/gs_graph/connections/threads_spec.rb +12 -0
- data/spec/gs_graph/connections/user_achievements_spec.rb +37 -0
- data/spec/gs_graph/connections/user_likes_spec.rb +55 -0
- data/spec/gs_graph/connections/videos_spec.rb +27 -0
- data/spec/gs_graph/connections/votes_spec.rb +15 -0
- data/spec/gs_graph/debugger_spec.rb +33 -0
- data/spec/gs_graph/doc_spec.rb +27 -0
- data/spec/gs_graph/domain_spec.rb +23 -0
- data/spec/gs_graph/education_spec.rb +61 -0
- data/spec/gs_graph/event_spec.rb +70 -0
- data/spec/gs_graph/exception_spec.rb +310 -0
- data/spec/gs_graph/friend_list_spec.rb +22 -0
- data/spec/gs_graph/group_spec.rb +28 -0
- data/spec/gs_graph/image_spec.rb +16 -0
- data/spec/gs_graph/insight_spec.rb +18 -0
- data/spec/gs_graph/link_spec.rb +41 -0
- data/spec/gs_graph/location_spec.rb +28 -0
- data/spec/gs_graph/message_spec.rb +47 -0
- data/spec/gs_graph/node_spec.rb +91 -0
- data/spec/gs_graph/note_spec.rb +37 -0
- data/spec/gs_graph/notification_spec.rb +59 -0
- data/spec/gs_graph/offer_spec.rb +30 -0
- data/spec/gs_graph/open_graph/action_spec.rb +112 -0
- data/spec/gs_graph/open_graph/application_context_spec.rb +28 -0
- data/spec/gs_graph/open_graph/object_spec.rb +76 -0
- data/spec/gs_graph/open_graph/user_context_spec.rb +33 -0
- data/spec/gs_graph/order_spec.rb +66 -0
- data/spec/gs_graph/page/local_business_spec.rb +88 -0
- data/spec/gs_graph/page/movie_spec.rb +25 -0
- data/spec/gs_graph/page/music_spec.rb +25 -0
- data/spec/gs_graph/page/person_spec.rb +23 -0
- data/spec/gs_graph/page/product_spec.rb +36 -0
- data/spec/gs_graph/page_spec.rb +81 -0
- data/spec/gs_graph/photo_spec.rb +85 -0
- data/spec/gs_graph/place_spec.rb +8 -0
- data/spec/gs_graph/post_spec.rb +238 -0
- data/spec/gs_graph/privacy_spec.rb +33 -0
- data/spec/gs_graph/project_spec.rb +46 -0
- data/spec/gs_graph/promotable_post_spec.rb +57 -0
- data/spec/gs_graph/qeustion_option_spec.rb +35 -0
- data/spec/gs_graph/query_spec.rb +73 -0
- data/spec/gs_graph/question_spec.rb +73 -0
- data/spec/gs_graph/reach_estimate_spec.rb +48 -0
- data/spec/gs_graph/searchable_spec.rb +47 -0
- data/spec/gs_graph/seriarization_spec.rb +29 -0
- data/spec/gs_graph/status_spec.rb +31 -0
- data/spec/gs_graph/subscription_spec.rb +5 -0
- data/spec/gs_graph/tag_spec.rb +34 -0
- data/spec/gs_graph/tagged_object_spec.rb +45 -0
- data/spec/gs_graph/targeting_spec.rb +34 -0
- data/spec/gs_graph/test_user_spec.rb +50 -0
- data/spec/gs_graph/thread_spec.rb +86 -0
- data/spec/gs_graph/user_achievement_spec.rb +53 -0
- data/spec/gs_graph/user_spec.rb +185 -0
- data/spec/gs_graph/venue_spec.rb +23 -0
- data/spec/gs_graph/video_spec.rb +31 -0
- data/spec/gs_graph/work_spec.rb +101 -0
- data/spec/gs_graph_spec.rb +57 -0
- data/spec/spec_helper.rb +9 -0
- metadata +538 -0
data/.document
ADDED
data/.gitattributes
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Custom for Visual Studio
|
|
5
|
+
*.cs diff=csharp
|
|
6
|
+
*.sln merge=union
|
|
7
|
+
*.csproj merge=union
|
|
8
|
+
*.vbproj merge=union
|
|
9
|
+
*.fsproj merge=union
|
|
10
|
+
*.dbproj merge=union
|
|
11
|
+
|
|
12
|
+
# Standard to msysgit
|
|
13
|
+
*.doc diff=astextplain
|
|
14
|
+
*.DOC diff=astextplain
|
|
15
|
+
*.docx diff=astextplain
|
|
16
|
+
*.DOCX diff=astextplain
|
|
17
|
+
*.dot diff=astextplain
|
|
18
|
+
*.DOT diff=astextplain
|
|
19
|
+
*.pdf diff=astextplain
|
|
20
|
+
*.PDF diff=astextplain
|
|
21
|
+
*.rtf diff=astextplain
|
|
22
|
+
*.RTF diff=astextplain
|
data/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
## MAC OS
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
## TEXTMATE
|
|
5
|
+
*.tmproj
|
|
6
|
+
tmtags
|
|
7
|
+
|
|
8
|
+
## EMACS
|
|
9
|
+
*~
|
|
10
|
+
\#*
|
|
11
|
+
.\#*
|
|
12
|
+
|
|
13
|
+
## VIM
|
|
14
|
+
*.swp
|
|
15
|
+
|
|
16
|
+
## RVM
|
|
17
|
+
.rvmrc
|
|
18
|
+
|
|
19
|
+
## PROJECT::GENERAL
|
|
20
|
+
coverage*
|
|
21
|
+
rdoc
|
|
22
|
+
pkg
|
|
23
|
+
|
|
24
|
+
## PROJECT::SPECIFIC
|
|
25
|
+
.rbenv-version
|
|
26
|
+
/nbproject/private/
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
gs_graph (2.6.4)
|
|
5
|
+
httpclient (>= 2.2.0.2)
|
|
6
|
+
multi_json (>= 1.3)
|
|
7
|
+
rack-oauth2 (>= 0.14.4)
|
|
8
|
+
tzinfo
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: http://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
actionpack (3.2.11)
|
|
14
|
+
activemodel (= 3.2.11)
|
|
15
|
+
activesupport (= 3.2.11)
|
|
16
|
+
builder (~> 3.0.0)
|
|
17
|
+
erubis (~> 2.7.0)
|
|
18
|
+
journey (~> 1.0.4)
|
|
19
|
+
rack (~> 1.4.0)
|
|
20
|
+
rack-cache (~> 1.2)
|
|
21
|
+
rack-test (~> 0.6.1)
|
|
22
|
+
sprockets (~> 2.2.1)
|
|
23
|
+
activemodel (3.2.11)
|
|
24
|
+
activesupport (= 3.2.11)
|
|
25
|
+
builder (~> 3.0.0)
|
|
26
|
+
activesupport (3.2.11)
|
|
27
|
+
i18n (~> 0.6)
|
|
28
|
+
multi_json (~> 1.0)
|
|
29
|
+
addressable (2.3.2)
|
|
30
|
+
attr_required (0.0.5)
|
|
31
|
+
builder (3.0.4)
|
|
32
|
+
configatron (2.9.1)
|
|
33
|
+
yamler (>= 0.1.0)
|
|
34
|
+
cover_me (1.2.0)
|
|
35
|
+
configatron
|
|
36
|
+
hashie
|
|
37
|
+
crack (0.3.2)
|
|
38
|
+
diff-lcs (1.1.3)
|
|
39
|
+
erubis (2.7.0)
|
|
40
|
+
gs_graph-mock (0.1.1)
|
|
41
|
+
gs_graph
|
|
42
|
+
rspec
|
|
43
|
+
webmock
|
|
44
|
+
hashie (1.2.0)
|
|
45
|
+
hike (1.2.1)
|
|
46
|
+
httpclient (2.3.2)
|
|
47
|
+
i18n (0.6.1)
|
|
48
|
+
journey (1.0.4)
|
|
49
|
+
multi_json (1.5.0)
|
|
50
|
+
oj (2.0.2)
|
|
51
|
+
rack (1.4.4)
|
|
52
|
+
rack-cache (1.2)
|
|
53
|
+
rack (>= 0.4)
|
|
54
|
+
rack-oauth2 (1.0.0)
|
|
55
|
+
activesupport (>= 2.3)
|
|
56
|
+
attr_required (>= 0.0.5)
|
|
57
|
+
httpclient (>= 2.2.0.2)
|
|
58
|
+
i18n
|
|
59
|
+
multi_json (>= 1.3.6)
|
|
60
|
+
rack (>= 1.1)
|
|
61
|
+
rack-test (0.6.2)
|
|
62
|
+
rack (>= 1.0)
|
|
63
|
+
rake (10.0.3)
|
|
64
|
+
rspec (2.12.0)
|
|
65
|
+
rspec-core (~> 2.12.0)
|
|
66
|
+
rspec-expectations (~> 2.12.0)
|
|
67
|
+
rspec-mocks (~> 2.12.0)
|
|
68
|
+
rspec-core (2.12.2)
|
|
69
|
+
rspec-expectations (2.12.1)
|
|
70
|
+
diff-lcs (~> 1.1.3)
|
|
71
|
+
rspec-mocks (2.12.2)
|
|
72
|
+
sprockets (2.2.2)
|
|
73
|
+
hike (~> 1.2)
|
|
74
|
+
multi_json (~> 1.0)
|
|
75
|
+
rack (~> 1.0)
|
|
76
|
+
tilt (~> 1.1, != 1.3.0)
|
|
77
|
+
tilt (1.3.3)
|
|
78
|
+
tzinfo (0.3.35)
|
|
79
|
+
webmock (1.9.0)
|
|
80
|
+
addressable (>= 2.2.7)
|
|
81
|
+
crack (>= 0.1.7)
|
|
82
|
+
yamler (0.1.0)
|
|
83
|
+
|
|
84
|
+
PLATFORMS
|
|
85
|
+
ruby
|
|
86
|
+
|
|
87
|
+
DEPENDENCIES
|
|
88
|
+
actionpack (>= 3.0.6)
|
|
89
|
+
cover_me (>= 1.2.0)
|
|
90
|
+
gs_graph!
|
|
91
|
+
gs_graph-mock (>= 0.1.1)
|
|
92
|
+
jruby-openssl (>= 0.7)
|
|
93
|
+
oj
|
|
94
|
+
rake (>= 0.8)
|
|
95
|
+
rspec (>= 2)
|
data/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2010 nov matake
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
= GSGraph
|
|
2
|
+
|
|
3
|
+
A full-stack GameStamper/GoPlay Graph API wrapper in Ruby
|
|
4
|
+
for use with Rails. This project (and README) is based off of the original Facebook project fb_graph
|
|
5
|
+
by nov mattake (https://github.com/rockycaamano/fb_graph)
|
|
6
|
+
and is a direct descendent of the contributions of rockycaamano
|
|
7
|
+
(https://github.com/rockycaamano/gs_graph).
|
|
8
|
+
|
|
9
|
+
== Installation
|
|
10
|
+
|
|
11
|
+
We have not yet registered this gem with rubygems.org. Once we do, the install will be simply:
|
|
12
|
+
|
|
13
|
+
gem install gs_graph
|
|
14
|
+
|
|
15
|
+
However, as of now, you will need to do the following:
|
|
16
|
+
|
|
17
|
+
1. check out the repository
|
|
18
|
+
2. in the gs_graph directory on your system, run:
|
|
19
|
+
|
|
20
|
+
gem build gs_graph.gemspec
|
|
21
|
+
|
|
22
|
+
3. from within your project, run:
|
|
23
|
+
|
|
24
|
+
gem install [PATH_TO_GSGRAPH_GEM]/gsgraph-2.6.5.gem
|
|
25
|
+
|
|
26
|
+
== Use
|
|
27
|
+
|
|
28
|
+
Because the GoPlay network has potentially many different APIs for accessing graph data, and because Ruby on Rails locks down
|
|
29
|
+
http entities such as the request and session, there is an extra step required for using this SDK in a Ruby on Rails app.
|
|
30
|
+
In your application controller, simply include the following in order to allow GSGraph to access the correct APIs:
|
|
31
|
+
|
|
32
|
+
class ApplicationController < ActionController::Base
|
|
33
|
+
|
|
34
|
+
before_filter :setup
|
|
35
|
+
protected
|
|
36
|
+
def setup
|
|
37
|
+
GSGraph::setup session, request
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
== Examples
|
|
42
|
+
|
|
43
|
+
Now GSGraph supports all objects listed here: http://developers.gamestamper.com/docs/reference/api/
|
|
44
|
+
Almost all connections for each object are also supported. ("attachments" and "shares" connections of message object are not supported yet)
|
|
45
|
+
|
|
46
|
+
You can also play with a Rails sample app here. http://fbgraphsample.heroku.com/
|
|
47
|
+
|
|
48
|
+
See GitHub wiki for more examples.
|
|
49
|
+
https://github.com/nov/gs_graph/wiki
|
|
50
|
+
|
|
51
|
+
=== GET
|
|
52
|
+
|
|
53
|
+
==== Basic Objects
|
|
54
|
+
|
|
55
|
+
user = GSGraph::User.me(ACCESS_TOKEN)
|
|
56
|
+
|
|
57
|
+
user = GSGraph::User.fetch('matake')
|
|
58
|
+
user.name # => 'Nov Matake'
|
|
59
|
+
user.picture # => 'https://graph.gamestamper.com/matake/picture'
|
|
60
|
+
|
|
61
|
+
# gs_graph doesn't access to Graph API until you call "fetch"
|
|
62
|
+
user = GSGraph::User.new('matake', :access_token => YOUR_ACCESS_TOKEN)
|
|
63
|
+
user.identifier # => "matake"
|
|
64
|
+
user.name # => nil
|
|
65
|
+
user.link # => nil
|
|
66
|
+
user = user.fetch
|
|
67
|
+
user.name # => "Nov Matake"
|
|
68
|
+
user.description # => "http://www.gamestamper.com/matake"
|
|
69
|
+
|
|
70
|
+
page = GSGraph::Page.fetch('smartfmteam')
|
|
71
|
+
page.name # => 'smart.fm'
|
|
72
|
+
page.picture # => 'https://graph.gamestamper.com/smart.fm/picture'
|
|
73
|
+
|
|
74
|
+
:
|
|
75
|
+
|
|
76
|
+
==== Connections
|
|
77
|
+
|
|
78
|
+
# Public connections
|
|
79
|
+
user = GSGraph::User.fetch('matake')
|
|
80
|
+
user.feed
|
|
81
|
+
user.posts
|
|
82
|
+
user.friends
|
|
83
|
+
user.tagged
|
|
84
|
+
user.family
|
|
85
|
+
:
|
|
86
|
+
|
|
87
|
+
# Private connections requires "access_token"
|
|
88
|
+
GSGraph::User.new('matake').friends # => raise GSGraph::Unauthorized
|
|
89
|
+
user = GSGraph::User.fetch('matake', :access_token => ACCESS_TOKEN)
|
|
90
|
+
user.albums
|
|
91
|
+
user.events
|
|
92
|
+
user.friends
|
|
93
|
+
user.likes
|
|
94
|
+
:
|
|
95
|
+
|
|
96
|
+
# "home" connection is only available for "me"
|
|
97
|
+
me = User.new('me', :access_token => ACCESS_TOKEN)
|
|
98
|
+
me.home
|
|
99
|
+
:
|
|
100
|
+
|
|
101
|
+
By default, GSGraph will only return the default fields. In order to
|
|
102
|
+
get a non-default field, you have to supply the connect with an options hash
|
|
103
|
+
specifying the field. An example for events:
|
|
104
|
+
|
|
105
|
+
user.events({:fields => "owner,name,description,picture"}) # { and } optional
|
|
106
|
+
|
|
107
|
+
An overview of which fields you can include in the graph API can be found at
|
|
108
|
+
https://developers.gamestamper.com/docs/reference/api/, which has a description
|
|
109
|
+
of the specific objects fields in the sidebar under "Objects".
|
|
110
|
+
|
|
111
|
+
==== Search
|
|
112
|
+
|
|
113
|
+
# all objects
|
|
114
|
+
GSGraph::Searchable.search("GSGraph") # => Array of Hash
|
|
115
|
+
|
|
116
|
+
# specify type
|
|
117
|
+
GSGraph::Page.search("GSGraph") # => Array of GSGraph::Page
|
|
118
|
+
GSGraph::User.search("matake", :access_token => ACCESS_TOKEN) # => Array of GSGraph::User
|
|
119
|
+
|
|
120
|
+
==== Pagination
|
|
121
|
+
|
|
122
|
+
# collection
|
|
123
|
+
user = GSGraph::User.new('matake', :access_token => ACCESS_TOKEN)
|
|
124
|
+
likes = user.likes # => Array of GSGraph::Like
|
|
125
|
+
likes.next # => Array of GSGraph::Like (next page)
|
|
126
|
+
likes.previous # => Array of GSGraph::Like (previous page)
|
|
127
|
+
likes.collection.next # => Hash for pagination options (ex. {"limit"=>"25", "until"=>"2010-08-08T03:17:21+0000"})
|
|
128
|
+
likes.collection.previous # => Hash for pagination options (ex. {"limit"=>"25", "since"=>"2010-08-08T06:28:20+0000"})
|
|
129
|
+
user.likes(likes.collection.next) # => same with likes.next
|
|
130
|
+
user.likes(likes.collection.previous) # => same with likes.previous
|
|
131
|
+
|
|
132
|
+
# search results
|
|
133
|
+
results = GSGraph::Page.search("GSGraph") # => Array of GSGraph::Page
|
|
134
|
+
results.next # => Array of GSGraph::Page (next page)
|
|
135
|
+
results.previous # => Array of GSGraph::Page (next page)
|
|
136
|
+
results.klass # => GSGraph::Page
|
|
137
|
+
results.collection.next # => Hash for pagination options (ex. {"limit"=>"25", "until"=>"2010-08-08T03:17:21+0000"})
|
|
138
|
+
results.collection.previous # => Hash for pagination options (ex. {"limit"=>"25", "since"=>"2010-08-08T06:28:20+0000"})
|
|
139
|
+
results.klass.search(results.query, results.collection.next) # => same with results.next
|
|
140
|
+
results.klass.search(results.query, results.collection.previous) # => same with results.previous
|
|
141
|
+
|
|
142
|
+
=== POST
|
|
143
|
+
|
|
144
|
+
==== Update status (wall post)
|
|
145
|
+
|
|
146
|
+
me = GSGraph::User.me(ACCESS_TOKEN)
|
|
147
|
+
me.feed!(
|
|
148
|
+
:message => 'Updating via GSGraph',
|
|
149
|
+
:picture => 'https://graph.gamestamper.com/matake/picture',
|
|
150
|
+
:link => 'https://github.com/nov/gs_graph',
|
|
151
|
+
:name => 'GSGraph',
|
|
152
|
+
:description => 'A Ruby wrapper for Facebook Graph API'
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
==== Post a like/comment to a post
|
|
156
|
+
|
|
157
|
+
post = GSGraph::Page.new(117513961602338).feed.first
|
|
158
|
+
bool = post.like!(
|
|
159
|
+
:access_token => ACCESS_TOKEN
|
|
160
|
+
)
|
|
161
|
+
comment = post.comment!(
|
|
162
|
+
:access_token => ACCESS_TOKEN,
|
|
163
|
+
:message => 'Hey, I\'m testing you!'
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
==== Post a note
|
|
167
|
+
|
|
168
|
+
page = GSGraph::Page.new(117513961602338)
|
|
169
|
+
note = page.note!(
|
|
170
|
+
:access_token => ACCESS_TOKEN,
|
|
171
|
+
:subject => 'testing',
|
|
172
|
+
:message => 'Hey, I\'m testing you!'
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
==== Post a link
|
|
176
|
+
|
|
177
|
+
me = GSGraph::User.me(ACCESS_TOKEN)
|
|
178
|
+
link = me.link!(
|
|
179
|
+
:link => 'https://github.com/nov/gs_graph',
|
|
180
|
+
:message => 'A Ruby wrapper for Facebook Graph API.'
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
==== Create Event, respond to it
|
|
184
|
+
|
|
185
|
+
me = GSGraph::User.me(ACCESS_TOKEN)
|
|
186
|
+
event = me.event!(
|
|
187
|
+
:name => 'GSGraph test event',
|
|
188
|
+
:start_time => 1.week.from_now,
|
|
189
|
+
:end_time => 2.week.from_now
|
|
190
|
+
)
|
|
191
|
+
bool = event.attending!(
|
|
192
|
+
:access_token => ACCESS_TOKEN
|
|
193
|
+
)
|
|
194
|
+
bool = event.maybe!(
|
|
195
|
+
:access_token => ACCESS_TOKEN
|
|
196
|
+
)
|
|
197
|
+
bool = event.declined!(
|
|
198
|
+
:access_token => ACCESS_TOKEN
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
==== Create an album
|
|
202
|
+
|
|
203
|
+
me = GSGraph::User.me(ACCESS_TOKEN)
|
|
204
|
+
album = me.album!(
|
|
205
|
+
:name => 'GSGraph test',
|
|
206
|
+
:message => 'test test test'
|
|
207
|
+
) # => now facebook Graph API returns weird response for this call
|
|
208
|
+
|
|
209
|
+
==== Upload a photo to an album
|
|
210
|
+
|
|
211
|
+
me = GSGraph::User.me(ACCESS_TOKEN)
|
|
212
|
+
album = me.albums.first
|
|
213
|
+
album.photo!(
|
|
214
|
+
:access_token => ACCESS_TOKEN,
|
|
215
|
+
:source => File.new('/Users/nov/Desktop/nov.gif', 'rb'), # 'rb' is needed only on windows
|
|
216
|
+
:message => 'Hello, where is photo?'
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
=== DELETE
|
|
220
|
+
|
|
221
|
+
==== Delete an object
|
|
222
|
+
|
|
223
|
+
post = GSGraph::Page.new(117513961602338).feed.first
|
|
224
|
+
bool = post.like!(
|
|
225
|
+
:access_token => ACCESS_TOKEN
|
|
226
|
+
)
|
|
227
|
+
comment = post.comment!(
|
|
228
|
+
:access_token => ACCESS_TOKEN,
|
|
229
|
+
:message => 'Hey, I\'m testing you!'
|
|
230
|
+
)
|
|
231
|
+
comment.destroy(:access_token => ACCESS_TOKEN)
|
|
232
|
+
post.unlike!(:access_token => ACCESS_TOKEN)
|
|
233
|
+
post.destroy(:access_token => ACCESS_TOKEN)
|
|
234
|
+
|
|
235
|
+
=== Authentication
|
|
236
|
+
|
|
237
|
+
Both Facebook JavaScript SDK and normal OAuth2 flow is supported.
|
|
238
|
+
Below I show simple sample code.
|
|
239
|
+
You can also see https://github.com/nov/gs_graph_sample for more details Rails3 sample application.
|
|
240
|
+
|
|
241
|
+
In addition, if you are migrating an application that uses old-style session keys you can exchange
|
|
242
|
+
the keys for access tokens.
|
|
243
|
+
See more here: http://developers.gamestamper.com/docs/authentication/fb_sig/
|
|
244
|
+
|
|
245
|
+
==== JavaScript SDK
|
|
246
|
+
|
|
247
|
+
fb_auth = GSGraph::Auth.new(YOUR_APP_ID, YOUR_APPLICATION_SECRET)
|
|
248
|
+
fb_auth.client # => Rack::OAuth2::Client
|
|
249
|
+
|
|
250
|
+
# get Facebook's auth cookie in advance using their JS SDK
|
|
251
|
+
fb_auth.from_cookie(cookies)
|
|
252
|
+
fb_auth.access_token # => Rack::OAuth2::AccessToken
|
|
253
|
+
fb_auth.user # => GSGraph::User (only basic attributes)
|
|
254
|
+
fb_auth.user.fetch # => fetch more details
|
|
255
|
+
|
|
256
|
+
==== Normal OAuth2 Flow
|
|
257
|
+
|
|
258
|
+
# setup client
|
|
259
|
+
client = fb_auth.client
|
|
260
|
+
client.redirect_uri = "http://your.client.com/facebook/callback"
|
|
261
|
+
|
|
262
|
+
# redirect user to facebook
|
|
263
|
+
redirect_to client.authorization_uri(
|
|
264
|
+
:scope => [:email, :read_stream, :offline_access]
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
# in callback
|
|
268
|
+
client.authorization_code = params[:code]
|
|
269
|
+
access_token = client.access_token! :client_auth_body # => Rack::OAuth2::AccessToken
|
|
270
|
+
GSGraph::User.me(access_token).fetch # => GSGraph::User
|
|
271
|
+
|
|
272
|
+
==== Extend Access Token Lifetime
|
|
273
|
+
|
|
274
|
+
# setup client
|
|
275
|
+
fb_auth = GSGraph::Auth.new(YOUR_APP_ID, YOUR_APPLICATION_SECRET)
|
|
276
|
+
fb_auth.exchange_token! 'short-life-access-token'
|
|
277
|
+
fb_auth.access_token # => Rack::OAuth2::AccessToken
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
=== Analytics
|
|
281
|
+
|
|
282
|
+
app = GSGraph::Application.new(YOUR_APP_ID, :secret => YOUR_APPLICATION_SECRET)
|
|
283
|
+
app.insights # => Array of GSGraph::Insight
|
|
284
|
+
|
|
285
|
+
=== Test User
|
|
286
|
+
|
|
287
|
+
Not tested well yet.
|
|
288
|
+
Sample is here.
|
|
289
|
+
https://gist.github.com/752974
|
|
290
|
+
|
|
291
|
+
=== FQL
|
|
292
|
+
|
|
293
|
+
Not tested well yet.
|
|
294
|
+
Sample is here.
|
|
295
|
+
https://gist.github.com/752914
|
|
296
|
+
|
|
297
|
+
=== More Examples?
|
|
298
|
+
|
|
299
|
+
See GitHub wiki for more examples.
|
|
300
|
+
https://github.com/nov/gs_graph/wiki
|
|
301
|
+
|
|
302
|
+
== Note on Patches/Pull Requests
|
|
303
|
+
|
|
304
|
+
* Fork the project.
|
|
305
|
+
* Make your feature addition or bug fix.
|
|
306
|
+
* Add tests for it. This is important so I don't break it in a
|
|
307
|
+
future version unintentionally.
|
|
308
|
+
* Commit, do not mess with rakefile, version, or history.
|
|
309
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
310
|
+
* Send me a pull request. Bonus points for topic branches.
|
|
311
|
+
|
|
312
|
+
== Copyright
|
|
313
|
+
|
|
314
|
+
Copyright (c) 2010 nov matake. See LICENSE for details.
|