fgraph 0.1.0 → 0.1.1
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/History +5 -2
- data/README.rdoc +12 -0
- data/VERSION.yml +2 -2
- data/lib/fgraph/client.rb +11 -0
- metadata +2 -2
data/History
CHANGED
data/README.rdoc
CHANGED
@@ -104,6 +104,18 @@ OAuth Application Access Token, required to access application anlytics data:
|
|
104
104
|
# https://graph.facebook.com/app_id/insights/application_api_call/day?access_token=...
|
105
105
|
FGraph.insights('[app_id]', '[app_access_token]', :metric_path => 'application_api_call/day')
|
106
106
|
|
107
|
+
=== FGraph::Client
|
108
|
+
|
109
|
+
# Save the hassles the extra params, initialize with default options
|
110
|
+
fg_client = FGraph::Client.new(:client_id => '...', :client_secret => '...')
|
111
|
+
fg_client.oauth_authorize_url(:redirect_uri => 'http://www.example.com/oauth_redirect')
|
112
|
+
fg_client.oauth_access_token(:redirect_uri => '...', :code => '...')
|
113
|
+
|
114
|
+
# Intialize with access token
|
115
|
+
fg_client = FGraph::Client.new(:access_token => '...')
|
116
|
+
fg_client.me
|
117
|
+
fg.client.publish_feed('herryanto', :message => 'Cool!')
|
118
|
+
|
107
119
|
=== Pagination Options
|
108
120
|
|
109
121
|
* <tt>limit</tt> - max no of records
|
data/VERSION.yml
CHANGED
data/lib/fgraph/client.rb
CHANGED
@@ -18,6 +18,17 @@ module FGraph
|
|
18
18
|
# current user profile.
|
19
19
|
# * <tt>app_access_token</tt> - Application access token, required to access Facebook insights.
|
20
20
|
# Auto generated if client_id and client_secret option are provided.
|
21
|
+
#
|
22
|
+
# # Initialize with default options
|
23
|
+
# fg_client = FGraph::Client.new(:client_id => '...', :client_secret => '...')
|
24
|
+
# fg_client.oauth_authorize_url(:redirect_uri => 'http://www.example.com/oauth_redirect')
|
25
|
+
# fg_client.oauth_access_token(:redirect_uri => '...', :code => '...')
|
26
|
+
#
|
27
|
+
# # Intialize with access token
|
28
|
+
# fg_client = FGraph::Client.new(:access_token => '...')
|
29
|
+
# fg_client.me
|
30
|
+
# fg.client.publish_feed('herryanto', :message => 'Cool!')
|
31
|
+
#
|
21
32
|
def initialize(options={})
|
22
33
|
@options = options
|
23
34
|
end
|