fb_graph 0.0.1
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 +17 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/fb_graph.gemspec +107 -0
- data/lib/fb_graph/connections/collection.rb +31 -0
- data/lib/fb_graph/connections/feed.rb +9 -0
- data/lib/fb_graph/connections/home.rb +9 -0
- data/lib/fb_graph/connections/likes.rb +12 -0
- data/lib/fb_graph/connections/picture.rb +14 -0
- data/lib/fb_graph/connections/posts.rb +15 -0
- data/lib/fb_graph/connections/statuses.rb +12 -0
- data/lib/fb_graph/connections/tagged.rb +9 -0
- data/lib/fb_graph/connections.rb +6 -0
- data/lib/fb_graph/node.rb +62 -0
- data/lib/fb_graph/page.rb +14 -0
- data/lib/fb_graph/post.rb +39 -0
- data/lib/fb_graph/status.rb +18 -0
- data/lib/fb_graph/user.rb +31 -0
- data/lib/fb_graph.rb +26 -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/users/arjun_private.json +99 -0
- data/spec/fake_json/users/arjun_public.json +7 -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 +383 -0
- data/spec/fake_json/users/home/me_public.json +6 -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/statuses/arjun_private.json +233 -0
- data/spec/fake_json/users/statuses/arjun_public.json +6 -0
- data/spec/fb_graph/connections/collection_spec.rb +15 -0
- data/spec/fb_graph/connections/home_spec.rb +38 -0
- data/spec/fb_graph/connections/likes_spec.rb +33 -0
- data/spec/fb_graph/connections/picture_spec.rb +29 -0
- data/spec/fb_graph/connections/statuses_spec.rb +83 -0
- data/spec/fb_graph/node_spec.rb +13 -0
- data/spec/fb_graph/page_spec.rb +19 -0
- data/spec/fb_graph/user_spec.rb +41 -0
- data/spec/fb_graph_spec.rb +13 -0
- data/spec/helpers/fake_json_helper.rb +9 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +18 -0
- metadata +155 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 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,17 @@
|
|
1
|
+
= fb_graph
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(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)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 nov matake. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = 'fb_graph'
|
8
|
+
gem.summary = %Q{Facebook Graph API library for Ruby}
|
9
|
+
gem.description = %Q{Facebook Graph API library for Ruby}
|
10
|
+
gem.email = 'nov@matake.jp'
|
11
|
+
gem.homepage = 'http://github.com/nov/fb_graph'
|
12
|
+
gem.authors = ['nov matake']
|
13
|
+
gem.add_development_dependency 'json'
|
14
|
+
gem.add_development_dependency 'activesupport'
|
15
|
+
gem.add_development_dependency 'rest-client'
|
16
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
+
end
|
18
|
+
Jeweler::GemcutterTasks.new
|
19
|
+
rescue LoadError
|
20
|
+
puts 'Jeweler not available. Install it with: gem install jeweler'
|
21
|
+
end
|
22
|
+
|
23
|
+
begin
|
24
|
+
require 'spec/rake/spectask'
|
25
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
26
|
+
spec.fail_on_error = false
|
27
|
+
spec.libs << 'lib' << 'spec'
|
28
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
29
|
+
end
|
30
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
31
|
+
spec.libs << 'lib' << 'spec'
|
32
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
33
|
+
spec.rcov = true
|
34
|
+
spec.rcov_opts = ['--exclude spec,gems']
|
35
|
+
end
|
36
|
+
task :spec => :check_dependencies
|
37
|
+
task :default => :spec
|
38
|
+
rescue LoadError
|
39
|
+
puts 'RSpec not available. Install it with: gem install rspec'
|
40
|
+
end
|
41
|
+
|
42
|
+
require 'rake/rdoctask'
|
43
|
+
Rake::RDocTask.new do |rdoc|
|
44
|
+
version = File.read('VERSION')
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = 'fb_graph #{version}'
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/fb_graph.gemspec
ADDED
@@ -0,0 +1,107 @@
|
|
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 = "0.0.1"
|
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-04-26}
|
13
|
+
s.description = %q{Facebook Graph API library for 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
|
+
"fb_graph.gemspec",
|
27
|
+
"lib/fb_graph.rb",
|
28
|
+
"lib/fb_graph/connections.rb",
|
29
|
+
"lib/fb_graph/connections/collection.rb",
|
30
|
+
"lib/fb_graph/connections/feed.rb",
|
31
|
+
"lib/fb_graph/connections/home.rb",
|
32
|
+
"lib/fb_graph/connections/likes.rb",
|
33
|
+
"lib/fb_graph/connections/picture.rb",
|
34
|
+
"lib/fb_graph/connections/posts.rb",
|
35
|
+
"lib/fb_graph/connections/statuses.rb",
|
36
|
+
"lib/fb_graph/connections/tagged.rb",
|
37
|
+
"lib/fb_graph/node.rb",
|
38
|
+
"lib/fb_graph/page.rb",
|
39
|
+
"lib/fb_graph/post.rb",
|
40
|
+
"lib/fb_graph/status.rb",
|
41
|
+
"lib/fb_graph/user.rb",
|
42
|
+
"spec/fake_json/pages/platform_private.json",
|
43
|
+
"spec/fake_json/pages/platform_public.json",
|
44
|
+
"spec/fake_json/pages/statuses/platform_private.json",
|
45
|
+
"spec/fake_json/pages/statuses/platform_public.json",
|
46
|
+
"spec/fake_json/users/arjun_private.json",
|
47
|
+
"spec/fake_json/users/arjun_public.json",
|
48
|
+
"spec/fake_json/users/home/arjun_private.json",
|
49
|
+
"spec/fake_json/users/home/arjun_public.json",
|
50
|
+
"spec/fake_json/users/home/me_private.json",
|
51
|
+
"spec/fake_json/users/home/me_public.json",
|
52
|
+
"spec/fake_json/users/likes/arjun_private.json",
|
53
|
+
"spec/fake_json/users/likes/arjun_public.json",
|
54
|
+
"spec/fake_json/users/statuses/arjun_private.json",
|
55
|
+
"spec/fake_json/users/statuses/arjun_public.json",
|
56
|
+
"spec/fb_graph/connections/collection_spec.rb",
|
57
|
+
"spec/fb_graph/connections/home_spec.rb",
|
58
|
+
"spec/fb_graph/connections/likes_spec.rb",
|
59
|
+
"spec/fb_graph/connections/picture_spec.rb",
|
60
|
+
"spec/fb_graph/connections/statuses_spec.rb",
|
61
|
+
"spec/fb_graph/node_spec.rb",
|
62
|
+
"spec/fb_graph/page_spec.rb",
|
63
|
+
"spec/fb_graph/user_spec.rb",
|
64
|
+
"spec/fb_graph_spec.rb",
|
65
|
+
"spec/helpers/fake_json_helper.rb",
|
66
|
+
"spec/spec.opts",
|
67
|
+
"spec/spec_helper.rb"
|
68
|
+
]
|
69
|
+
s.homepage = %q{http://github.com/nov/fb_graph}
|
70
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
71
|
+
s.require_paths = ["lib"]
|
72
|
+
s.rubygems_version = %q{1.3.6}
|
73
|
+
s.summary = %q{Facebook Graph API library for Ruby}
|
74
|
+
s.test_files = [
|
75
|
+
"spec/fb_graph/connections/collection_spec.rb",
|
76
|
+
"spec/fb_graph/connections/home_spec.rb",
|
77
|
+
"spec/fb_graph/connections/likes_spec.rb",
|
78
|
+
"spec/fb_graph/connections/picture_spec.rb",
|
79
|
+
"spec/fb_graph/connections/statuses_spec.rb",
|
80
|
+
"spec/fb_graph/node_spec.rb",
|
81
|
+
"spec/fb_graph/page_spec.rb",
|
82
|
+
"spec/fb_graph/user_spec.rb",
|
83
|
+
"spec/fb_graph_spec.rb",
|
84
|
+
"spec/helpers/fake_json_helper.rb",
|
85
|
+
"spec/spec_helper.rb"
|
86
|
+
]
|
87
|
+
|
88
|
+
if s.respond_to? :specification_version then
|
89
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
90
|
+
s.specification_version = 3
|
91
|
+
|
92
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
93
|
+
s.add_development_dependency(%q<json>, [">= 0"])
|
94
|
+
s.add_development_dependency(%q<activesupport>, [">= 0"])
|
95
|
+
s.add_development_dependency(%q<rest-client>, [">= 0"])
|
96
|
+
else
|
97
|
+
s.add_dependency(%q<json>, [">= 0"])
|
98
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
99
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
100
|
+
end
|
101
|
+
else
|
102
|
+
s.add_dependency(%q<json>, [">= 0"])
|
103
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
104
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module FbGraph
|
2
|
+
module Connections
|
3
|
+
class Collection < Array
|
4
|
+
attr_reader :previous, :next
|
5
|
+
|
6
|
+
def initialize(collection)
|
7
|
+
result = replace(collection[:data])
|
8
|
+
@previous, @next = {}, {}
|
9
|
+
if (paging = collection[:paging])
|
10
|
+
if paging[:previous]
|
11
|
+
@previous = parse_query(URI.parse(paging[:previous]).query)
|
12
|
+
end
|
13
|
+
if paging[:next]
|
14
|
+
@next = parse_query(URI.parse(paging[:next]).query)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def parse_query(query)
|
22
|
+
params = {}
|
23
|
+
query.split('&').each do |q|
|
24
|
+
key, value = q.split('=')
|
25
|
+
params[key] = value
|
26
|
+
end
|
27
|
+
params.with_indifferent_access
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module FbGraph
|
2
|
+
module Connections
|
3
|
+
module Posts
|
4
|
+
def posts(options = {})
|
5
|
+
options[:connection] ||= 'posts'
|
6
|
+
__self__ = options.delete(:self) || self
|
7
|
+
posts = Collection.new(__self__.send(:get, options))
|
8
|
+
posts.map! do |post|
|
9
|
+
Post.new(post.delete(:id), post)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
module_function :posts
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module FbGraph
|
2
|
+
module Connections
|
3
|
+
module Statuses
|
4
|
+
def statuses(options = {})
|
5
|
+
statuses = Collection.new(get(options.merge(:connection => 'statuses')))
|
6
|
+
statuses.map! do |status|
|
7
|
+
Status.new(status.delete(:id), status)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module FbGraph
|
2
|
+
class Node
|
3
|
+
attr_accessor :identifier, :endpoint, :access_token
|
4
|
+
|
5
|
+
def ==(other)
|
6
|
+
instance_variables.all? do |key|
|
7
|
+
instance_variable_get(key) == other.instance_variable_get(key)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(identifier, options = {})
|
12
|
+
@identifier = identifier
|
13
|
+
@endpoint = File.join(FbGraph::ROOT_URL, identifier)
|
14
|
+
@access_token = options[:access_token]
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.fetch(identifier, options = {})
|
18
|
+
_fetched_ = new(identifier).send(:get, options)
|
19
|
+
new(_fetched_.delete(:id), _fetched_)
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def get(options = {})
|
25
|
+
_endpoint_ = build_endpoint(options)
|
26
|
+
handle_response RestClient.get(_endpoint_)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def build_endpoint(options = {})
|
32
|
+
_endpoint_ = if options[:connection]
|
33
|
+
File.join(self.endpoint, options.delete(:connection))
|
34
|
+
else
|
35
|
+
self.endpoint
|
36
|
+
end
|
37
|
+
options[:access_token] ||= self.access_token
|
38
|
+
_options_ = options.reject do |k, v|
|
39
|
+
v.blank?
|
40
|
+
end
|
41
|
+
_endpoint_ << "?#{_options_.to_query}" unless _options_.blank?
|
42
|
+
_endpoint_
|
43
|
+
end
|
44
|
+
|
45
|
+
def handle_response(response)
|
46
|
+
_response_ = JSON.parse(response.to_s).with_indifferent_access
|
47
|
+
if _response_[:error]
|
48
|
+
case _response_[:error][:type]
|
49
|
+
when 'OAuthAccessTokenException'
|
50
|
+
raise FbGraph::Unauthorized.new(_response_[:error][:message])
|
51
|
+
when 'QueryParseException'
|
52
|
+
raise FbGraph::NotFound.new(_response_[:error][:message])
|
53
|
+
else
|
54
|
+
raise FbGraph::Exception.new("#{_response_[:error][:type]} :: #{_response_[:error][:message]}")
|
55
|
+
end
|
56
|
+
else
|
57
|
+
_response_
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FbGraph
|
2
|
+
class Page < Node
|
3
|
+
include Connections::Picture
|
4
|
+
include Connections::Statuses
|
5
|
+
|
6
|
+
attr_accessor :name, :category
|
7
|
+
|
8
|
+
def initialize(identifier, options = {})
|
9
|
+
super
|
10
|
+
@name = options[:name]
|
11
|
+
@category = options[:category]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module FbGraph
|
2
|
+
class Post < Node
|
3
|
+
attr_accessor :from, :to, :message, :picture, :link, :name, :caption, :description, :source, :icon, :attribution, :actions, :likes, :created_time, :updated_time
|
4
|
+
|
5
|
+
def initialize(identifier, options = {})
|
6
|
+
super
|
7
|
+
if (from = options[:from])
|
8
|
+
@from = if from[:category]
|
9
|
+
FbGraph::Page.new(from[:id], :name => from[:name], :category => from[:category])
|
10
|
+
else
|
11
|
+
FbGraph::User.new(from[:id], :name => from[:name])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
@to = []
|
15
|
+
if options[:to]
|
16
|
+
options[:to].each do |to|
|
17
|
+
@to << if to[:category]
|
18
|
+
FbGraph::Page.new(to[:id], :name => to[:name], :category => to[:category])
|
19
|
+
else
|
20
|
+
FbGraph::User.new(to[:id], :name => to[:name])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
@message = options[:message]
|
25
|
+
@picture = options[:picture]
|
26
|
+
@link = options[:link]
|
27
|
+
@name = options[:name]
|
28
|
+
@caption = options[:caption]
|
29
|
+
@description = options[:description]
|
30
|
+
@source = options[:source]
|
31
|
+
@icon = options[:icon]
|
32
|
+
@attribution = options[:attribution]
|
33
|
+
@actions = options[:actions]
|
34
|
+
@likes = options[:likes]
|
35
|
+
@created_time = options[:created_time]
|
36
|
+
@updated_time = options[:updated_time]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module FbGraph
|
2
|
+
class Status < Node
|
3
|
+
attr_accessor :from, :message, :updated_time
|
4
|
+
|
5
|
+
def initialize(identifier, options = {})
|
6
|
+
super
|
7
|
+
if (from = options[:from])
|
8
|
+
@from = if from[:category]
|
9
|
+
FbGraph::Page.new(from[:id], :name => from[:name], :category => from[:category])
|
10
|
+
else
|
11
|
+
FbGraph::User.new(from[:id], :name => from[:name])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
@message = options[:message]
|
15
|
+
@updated_time = options[:updated_time]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module FbGraph
|
2
|
+
class User < Node
|
3
|
+
include Connections::Home
|
4
|
+
include Connections::Feed
|
5
|
+
include Connections::Posts
|
6
|
+
include Connections::Likes
|
7
|
+
include Connections::Picture
|
8
|
+
include Connections::Statuses
|
9
|
+
|
10
|
+
attr_accessor :name, :last_name, :first_name, :link, :about, :birthday, :work, :education, :email, :website
|
11
|
+
|
12
|
+
def initialize(identifier, options = {})
|
13
|
+
super
|
14
|
+
@name = options[:name]
|
15
|
+
@last_name = options[:last_name]
|
16
|
+
@first_name = options[:first_name]
|
17
|
+
@link = options[:link]
|
18
|
+
@about = options[:about]
|
19
|
+
@birthday = options[:birthday]
|
20
|
+
@work = options[:work]
|
21
|
+
@education = options[:education]
|
22
|
+
@email = options[:email]
|
23
|
+
@website = options[:website]
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.me(access_token)
|
27
|
+
new('me', :access_token => access_token)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
data/lib/fb_graph.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'json'
|
3
|
+
require 'active_support'
|
4
|
+
require 'rest_client'
|
5
|
+
|
6
|
+
module FbGraph
|
7
|
+
ROOT_URL = "https://graph.facebook.com"
|
8
|
+
|
9
|
+
class FbGraph::Exception < StandardError; end
|
10
|
+
class FbGraph::Unauthorized < FbGraph::Exception; end
|
11
|
+
class FbGraph::NotFound < FbGraph::Exception; end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def node(identifier, options = {})
|
15
|
+
Node.new(identifier, options)
|
16
|
+
end
|
17
|
+
def user(identifier, options = {})
|
18
|
+
User.new(identifier, options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
Dir[File.dirname(__FILE__) + '/fb_graph/*.rb'].each do |file|
|
25
|
+
require file
|
26
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"id": "19292868552",
|
3
|
+
"name": "Facebook Platform",
|
4
|
+
"picture": "http://profile.ak.fbcdn.net/object3/1566/8/s19292868552_1660.jpg",
|
5
|
+
"link": "http://www.facebook.com/platform",
|
6
|
+
"category": "Technology",
|
7
|
+
"username": "platform",
|
8
|
+
"founded": "May 2007",
|
9
|
+
"company_overview": "Facebook Platform enables anyone to build social applications on Facebook and the web.",
|
10
|
+
"mission": "To make the web more open and social.",
|
11
|
+
"products": "Facebook Application Programming Interface (API)\nFacebook Query Language (FQL)\nFacebook Markup Language (FBML)\nFacebook JavaScript (FBJS)\nFacebook Connect\n",
|
12
|
+
"fan_count": 453163
|
13
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"id": "19292868552",
|
3
|
+
"name": "Facebook Platform",
|
4
|
+
"picture": "http://profile.ak.fbcdn.net/object3/1566/8/s19292868552_1660.jpg",
|
5
|
+
"link": "http://www.facebook.com/platform",
|
6
|
+
"category": "Technology",
|
7
|
+
"username": "platform",
|
8
|
+
"founded": "May 2007",
|
9
|
+
"company_overview": "Facebook Platform enables anyone to build social applications on Facebook and the web.",
|
10
|
+
"mission": "To make the web more open and social.",
|
11
|
+
"products": "Facebook Application Programming Interface (API)\nFacebook Query Language (FQL)\nFacebook Markup Language (FBML)\nFacebook JavaScript (FBJS)\nFacebook Connect\n",
|
12
|
+
"fan_count": 453163
|
13
|
+
}
|