fbgraph 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +1 -1
- data/Gemfile +1 -1
- data/README.textile +16 -3
- data/VERSION +1 -1
- data/fbgraph.gemspec +20 -2
- data/lib/fbgraph.rb +5 -3
- data/lib/fbgraph/base.rb +2 -0
- data/lib/fbgraph/selection.rb +3 -2
- metadata +55 -27
data/.bundle/config
CHANGED
data/Gemfile
CHANGED
data/README.textile
CHANGED
@@ -33,6 +33,10 @@ h2. Usage
|
|
33
33
|
|
34
34
|
p. FBGraph supports the most (no analytics yet) features of Facebook Open Graph API: developers.facebook.com/docs/reference/api/
|
35
35
|
|
36
|
+
**IMPORTANT!!** Facebook object IDs can be very large numbers--too large to fit in a regular SQL "INTEGER" column. If you use an integer column, your database will likely just store the largest number allowed resulting in a bug that may confound you beyond belief.
|
37
|
+
|
38
|
+
**IF YOU PLAN TO STORE FACEBOOK GRAPH OBJECT IDS IN YOUR DATABASE, YOU MUST USE A BIGINT COLUMN, NOT A STANDARD INTEGER COLUMN!**
|
39
|
+
|
36
40
|
h3. Initialization
|
37
41
|
|
38
42
|
p. Without a token (for authorization)
|
@@ -47,11 +51,11 @@ p. All methods are chainable
|
|
47
51
|
|
48
52
|
Examples:
|
49
53
|
|
50
|
-
notextile. <code>client.selection.me.photos.until(Time.now.to_s).since(3.days.ago).limit(10).info
|
54
|
+
notextile. <code>client.selection.me.photos.until(Time.now.to_s).since(3.days.ago).limit(10).info!</code>
|
51
55
|
|
52
|
-
notextile. <code>client.selection.user('id').videos.offset(10).info
|
56
|
+
notextile. <code>client.selection.user('id').videos.offset(10).info!</code>
|
53
57
|
|
54
|
-
notextile. <code>client.search.query('q').on('users').limit(20).info
|
58
|
+
notextile. <code>client.search.query('q').on('users').limit(20).info!</code>
|
55
59
|
|
56
60
|
h3. Rails config file
|
57
61
|
|
@@ -232,6 +236,15 @@ h3. Advanced
|
|
232
236
|
h4. not documented yet
|
233
237
|
|
234
238
|
|
239
|
+
h2 Credits
|
240
|
+
|
241
|
+
Examples:
|
242
|
+
|
243
|
+
notextile. <code> results = client.selection.user(USER_ID).payments.info!(:status => STATUS). </code>
|
244
|
+
|
245
|
+
notextile. <code> results = client.selection.order(ORDER_ID).publish!(:status => STATUS) </code>
|
246
|
+
|
247
|
+
|
235
248
|
h2. Contributions
|
236
249
|
|
237
250
|
p. Just do a pull request with the repo in sync.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0
|
data/fbgraph.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fbgraph}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.7.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nicolas Santa"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-26}
|
13
13
|
s.description = %q{A Gem for Facebook Open Graph API}
|
14
14
|
s.email = %q{nicolas55ar@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -58,6 +58,20 @@ Gem::Specification.new do |s|
|
|
58
58
|
s.add_runtime_dependency(%q<oauth2>, [">= 0"])
|
59
59
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
60
60
|
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
61
|
+
s.add_runtime_dependency(%q<i18n>, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
64
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
66
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
67
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
68
|
+
s.add_development_dependency(%q<redgreen>, [">= 0"])
|
69
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
70
|
+
s.add_runtime_dependency(%q<hashie>, [">= 0"])
|
71
|
+
s.add_runtime_dependency(%q<oauth2>, [">= 0"])
|
72
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
73
|
+
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
74
|
+
s.add_runtime_dependency(%q<i18n>, [">= 0"])
|
61
75
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
62
76
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
63
77
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
@@ -71,6 +85,7 @@ Gem::Specification.new do |s|
|
|
71
85
|
s.add_dependency(%q<oauth2>, [">= 0"])
|
72
86
|
s.add_dependency(%q<json>, [">= 0"])
|
73
87
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
88
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
74
89
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
75
90
|
s.add_dependency(%q<rake>, [">= 0"])
|
76
91
|
s.add_dependency(%q<bundler>, [">= 0"])
|
@@ -83,6 +98,7 @@ Gem::Specification.new do |s|
|
|
83
98
|
s.add_dependency(%q<oauth2>, [">= 0"])
|
84
99
|
s.add_dependency(%q<json>, [">= 0"])
|
85
100
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
101
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
86
102
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
87
103
|
s.add_dependency(%q<rake>, [">= 0"])
|
88
104
|
s.add_dependency(%q<bundler>, [">= 0"])
|
@@ -97,6 +113,7 @@ Gem::Specification.new do |s|
|
|
97
113
|
s.add_dependency(%q<oauth2>, [">= 0"])
|
98
114
|
s.add_dependency(%q<json>, [">= 0"])
|
99
115
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
116
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
100
117
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
101
118
|
s.add_dependency(%q<rake>, [">= 0"])
|
102
119
|
s.add_dependency(%q<bundler>, [">= 0"])
|
@@ -109,6 +126,7 @@ Gem::Specification.new do |s|
|
|
109
126
|
s.add_dependency(%q<oauth2>, [">= 0"])
|
110
127
|
s.add_dependency(%q<json>, [">= 0"])
|
111
128
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
129
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
112
130
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
113
131
|
s.add_dependency(%q<rake>, [">= 0"])
|
114
132
|
s.add_dependency(%q<bundler>, [">= 0"])
|
data/lib/fbgraph.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require "bundler/setup"
|
3
|
+
require 'active_support/all'
|
3
4
|
require 'oauth2'
|
4
5
|
require 'json'
|
5
6
|
require 'hashie'
|
@@ -21,7 +22,7 @@ module FBGraph
|
|
21
22
|
@config = {}
|
22
23
|
|
23
24
|
class << self
|
24
|
-
|
25
|
+
|
25
26
|
def load_config(yaml_file)
|
26
27
|
return false unless File.exist?(yaml_file)
|
27
28
|
cfg = YAML::load(File.open(yaml_file))
|
@@ -32,8 +33,9 @@ module FBGraph
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def config
|
35
|
-
@config
|
36
|
+
return @config if @config.any?
|
37
|
+
load_config(File.join(Rails.root , 'config' , 'facebook.yml')).freeze
|
36
38
|
end
|
37
|
-
|
39
|
+
|
38
40
|
end
|
39
41
|
end
|
data/lib/fbgraph/base.rb
CHANGED
@@ -50,6 +50,8 @@ module FBGraph
|
|
50
50
|
path = build_open_graph_path(nil,nil, params)
|
51
51
|
elsif @objects.is_a? String
|
52
52
|
path = build_open_graph_path(@objects , @connection_type, @params)
|
53
|
+
else
|
54
|
+
raise "No Facebook objects were recognized as selected; unable to build fb graph path."
|
53
55
|
end
|
54
56
|
|
55
57
|
# puts "FBGRAPH [GET]: #{path}"
|
data/lib/fbgraph/selection.rb
CHANGED
@@ -2,7 +2,7 @@ module FBGraph
|
|
2
2
|
class Selection < Base
|
3
3
|
|
4
4
|
OBJECTS = %w(user album event group link note page photo post status
|
5
|
-
video comment checkin friendlist thread).freeze
|
5
|
+
video comment checkin friendlist thread order application).freeze
|
6
6
|
|
7
7
|
CONNECTION_TYPES = %w(home photos comments feed noreply
|
8
8
|
maybe invited attending declined picture
|
@@ -11,7 +11,8 @@ module FBGraph
|
|
11
11
|
activities interests music books movies television
|
12
12
|
likes inbox outbox updates accounts checkins
|
13
13
|
friendlists platformrequests threads participants
|
14
|
-
former_participants senders messages insights
|
14
|
+
former_participants senders messages insights
|
15
|
+
subscriptions payments).freeze
|
15
16
|
|
16
17
|
OBJECTS.each do |object|
|
17
18
|
class_eval <<-METHOD
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbgraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 7
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nicolas Santa
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-26 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
type: :runtime
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
prerelease: false
|
93
|
-
name:
|
93
|
+
name: i18n
|
94
94
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
- 0
|
102
102
|
version: "0"
|
103
103
|
requirement: *id006
|
104
|
-
type: :
|
104
|
+
type: :runtime
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
prerelease: false
|
107
|
-
name:
|
107
|
+
name: jeweler
|
108
108
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
109
109
|
none: false
|
110
110
|
requirements:
|
@@ -118,7 +118,7 @@ dependencies:
|
|
118
118
|
type: :development
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
prerelease: false
|
121
|
-
name:
|
121
|
+
name: rake
|
122
122
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
123
123
|
none: false
|
124
124
|
requirements:
|
@@ -132,7 +132,7 @@ dependencies:
|
|
132
132
|
type: :development
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
prerelease: false
|
135
|
-
name:
|
135
|
+
name: bundler
|
136
136
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
137
137
|
none: false
|
138
138
|
requirements:
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
type: :development
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
prerelease: false
|
149
|
-
name:
|
149
|
+
name: fakeweb
|
150
150
|
version_requirements: &id010 !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
@@ -160,7 +160,7 @@ dependencies:
|
|
160
160
|
type: :development
|
161
161
|
- !ruby/object:Gem::Dependency
|
162
162
|
prerelease: false
|
163
|
-
name:
|
163
|
+
name: rspec
|
164
164
|
version_requirements: &id011 !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|
@@ -174,7 +174,7 @@ dependencies:
|
|
174
174
|
type: :development
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
176
|
prerelease: false
|
177
|
-
name:
|
177
|
+
name: rcov
|
178
178
|
version_requirements: &id012 !ruby/object:Gem::Requirement
|
179
179
|
none: false
|
180
180
|
requirements:
|
@@ -188,7 +188,7 @@ dependencies:
|
|
188
188
|
type: :development
|
189
189
|
- !ruby/object:Gem::Dependency
|
190
190
|
prerelease: false
|
191
|
-
name:
|
191
|
+
name: redgreen
|
192
192
|
version_requirements: &id013 !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
@@ -199,10 +199,10 @@ dependencies:
|
|
199
199
|
- 0
|
200
200
|
version: "0"
|
201
201
|
requirement: *id013
|
202
|
-
type: :
|
202
|
+
type: :development
|
203
203
|
- !ruby/object:Gem::Dependency
|
204
204
|
prerelease: false
|
205
|
-
name:
|
205
|
+
name: activesupport
|
206
206
|
version_requirements: &id014 !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
@@ -216,7 +216,7 @@ dependencies:
|
|
216
216
|
type: :runtime
|
217
217
|
- !ruby/object:Gem::Dependency
|
218
218
|
prerelease: false
|
219
|
-
name:
|
219
|
+
name: hashie
|
220
220
|
version_requirements: &id015 !ruby/object:Gem::Requirement
|
221
221
|
none: false
|
222
222
|
requirements:
|
@@ -230,7 +230,7 @@ dependencies:
|
|
230
230
|
type: :runtime
|
231
231
|
- !ruby/object:Gem::Dependency
|
232
232
|
prerelease: false
|
233
|
-
name:
|
233
|
+
name: oauth2
|
234
234
|
version_requirements: &id016 !ruby/object:Gem::Requirement
|
235
235
|
none: false
|
236
236
|
requirements:
|
@@ -244,7 +244,7 @@ dependencies:
|
|
244
244
|
type: :runtime
|
245
245
|
- !ruby/object:Gem::Dependency
|
246
246
|
prerelease: false
|
247
|
-
name:
|
247
|
+
name: json
|
248
248
|
version_requirements: &id017 !ruby/object:Gem::Requirement
|
249
249
|
none: false
|
250
250
|
requirements:
|
@@ -258,7 +258,7 @@ dependencies:
|
|
258
258
|
type: :runtime
|
259
259
|
- !ruby/object:Gem::Dependency
|
260
260
|
prerelease: false
|
261
|
-
name:
|
261
|
+
name: rest-client
|
262
262
|
version_requirements: &id018 !ruby/object:Gem::Requirement
|
263
263
|
none: false
|
264
264
|
requirements:
|
@@ -269,10 +269,10 @@ dependencies:
|
|
269
269
|
- 0
|
270
270
|
version: "0"
|
271
271
|
requirement: *id018
|
272
|
-
type: :
|
272
|
+
type: :runtime
|
273
273
|
- !ruby/object:Gem::Dependency
|
274
274
|
prerelease: false
|
275
|
-
name:
|
275
|
+
name: i18n
|
276
276
|
version_requirements: &id019 !ruby/object:Gem::Requirement
|
277
277
|
none: false
|
278
278
|
requirements:
|
@@ -283,10 +283,10 @@ dependencies:
|
|
283
283
|
- 0
|
284
284
|
version: "0"
|
285
285
|
requirement: *id019
|
286
|
-
type: :
|
286
|
+
type: :runtime
|
287
287
|
- !ruby/object:Gem::Dependency
|
288
288
|
prerelease: false
|
289
|
-
name:
|
289
|
+
name: jeweler
|
290
290
|
version_requirements: &id020 !ruby/object:Gem::Requirement
|
291
291
|
none: false
|
292
292
|
requirements:
|
@@ -300,7 +300,7 @@ dependencies:
|
|
300
300
|
type: :development
|
301
301
|
- !ruby/object:Gem::Dependency
|
302
302
|
prerelease: false
|
303
|
-
name:
|
303
|
+
name: rake
|
304
304
|
version_requirements: &id021 !ruby/object:Gem::Requirement
|
305
305
|
none: false
|
306
306
|
requirements:
|
@@ -314,7 +314,7 @@ dependencies:
|
|
314
314
|
type: :development
|
315
315
|
- !ruby/object:Gem::Dependency
|
316
316
|
prerelease: false
|
317
|
-
name:
|
317
|
+
name: bundler
|
318
318
|
version_requirements: &id022 !ruby/object:Gem::Requirement
|
319
319
|
none: false
|
320
320
|
requirements:
|
@@ -328,7 +328,7 @@ dependencies:
|
|
328
328
|
type: :development
|
329
329
|
- !ruby/object:Gem::Dependency
|
330
330
|
prerelease: false
|
331
|
-
name:
|
331
|
+
name: fakeweb
|
332
332
|
version_requirements: &id023 !ruby/object:Gem::Requirement
|
333
333
|
none: false
|
334
334
|
requirements:
|
@@ -342,7 +342,7 @@ dependencies:
|
|
342
342
|
type: :development
|
343
343
|
- !ruby/object:Gem::Dependency
|
344
344
|
prerelease: false
|
345
|
-
name:
|
345
|
+
name: rspec
|
346
346
|
version_requirements: &id024 !ruby/object:Gem::Requirement
|
347
347
|
none: false
|
348
348
|
requirements:
|
@@ -354,6 +354,34 @@ dependencies:
|
|
354
354
|
version: "0"
|
355
355
|
requirement: *id024
|
356
356
|
type: :development
|
357
|
+
- !ruby/object:Gem::Dependency
|
358
|
+
prerelease: false
|
359
|
+
name: rcov
|
360
|
+
version_requirements: &id025 !ruby/object:Gem::Requirement
|
361
|
+
none: false
|
362
|
+
requirements:
|
363
|
+
- - ">="
|
364
|
+
- !ruby/object:Gem::Version
|
365
|
+
hash: 3
|
366
|
+
segments:
|
367
|
+
- 0
|
368
|
+
version: "0"
|
369
|
+
requirement: *id025
|
370
|
+
type: :development
|
371
|
+
- !ruby/object:Gem::Dependency
|
372
|
+
prerelease: false
|
373
|
+
name: redgreen
|
374
|
+
version_requirements: &id026 !ruby/object:Gem::Requirement
|
375
|
+
none: false
|
376
|
+
requirements:
|
377
|
+
- - ">="
|
378
|
+
- !ruby/object:Gem::Version
|
379
|
+
hash: 3
|
380
|
+
segments:
|
381
|
+
- 0
|
382
|
+
version: "0"
|
383
|
+
requirement: *id026
|
384
|
+
type: :development
|
357
385
|
description: A Gem for Facebook Open Graph API
|
358
386
|
email: nicolas55ar@gmail.com
|
359
387
|
executables: []
|