mini_fb 0.1.7 → 0.1.8
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/README.markdown +49 -49
- data/lib/mini_fb.rb +1 -1
- data/test/mini_fb_tests.rb +28 -25
- metadata +2 -2
data/README.markdown
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
MiniFB - the simple miniature facebook library
|
2
|
-
==============================================
|
3
|
-
|
4
|
-
MiniFB is a small, lightweight Ruby library for interacting with the [Facebook API](http://wiki.developers.facebook.com/index.php/API).
|
5
|
-
|
6
|
-
Installation
|
7
|
-
-------------
|
8
|
-
|
9
|
-
We're using gemcutter so be sure to have gemcutter as a source, then:
|
10
|
-
|
11
|
-
gem install mini_fb
|
12
|
-
|
13
|
-
General Usage
|
14
|
-
-------------
|
15
|
-
|
16
|
-
The most general case is to use MiniFB.call method:
|
17
|
-
|
18
|
-
user_hash = MiniFB.call(FB_API_KEY, FB_SECRET, "Users.getInfo", "session_key"=>@session_key, "uids"=>@uid, "fields"=>User.all_fields)
|
19
|
-
|
20
|
-
Which simply returns the parsed json response from Facebook.
|
21
|
-
|
22
|
-
Some Higher Level Objects for Common Uses
|
23
|
-
----------------------
|
24
|
-
|
25
|
-
Get a MiniFB::Session:
|
26
|
-
|
27
|
-
@fb = MiniFB::Session.new(FB_API_KEY, FB_SECRET, @fb_session, @fb_uid)
|
28
|
-
|
29
|
-
With the session, you can then get the user information for the session/uid.
|
30
|
-
|
31
|
-
user = @fb.user
|
32
|
-
|
33
|
-
Then get info from the user:
|
34
|
-
|
35
|
-
first_name = user["first_name"]
|
36
|
-
|
37
|
-
Or profile photos:
|
38
|
-
|
39
|
-
photos = user.profile_photos
|
40
|
-
|
41
|
-
Or if you want other photos, try:
|
42
|
-
|
43
|
-
photos = @fb.photos("pids"=>[12343243,920382343,9208348])
|
44
|
-
|
45
|
-
Support
|
46
|
-
--------
|
47
|
-
|
48
|
-
Join our Discussion Group at: http://groups.google.com/group/mini_fb
|
49
|
-
|
1
|
+
MiniFB - the simple miniature facebook library
|
2
|
+
==============================================
|
3
|
+
|
4
|
+
MiniFB is a small, lightweight Ruby library for interacting with the [Facebook API](http://wiki.developers.facebook.com/index.php/API).
|
5
|
+
|
6
|
+
Installation
|
7
|
+
-------------
|
8
|
+
|
9
|
+
We're using gemcutter so be sure to have gemcutter as a source, then:
|
10
|
+
|
11
|
+
gem install mini_fb
|
12
|
+
|
13
|
+
General Usage
|
14
|
+
-------------
|
15
|
+
|
16
|
+
The most general case is to use MiniFB.call method:
|
17
|
+
|
18
|
+
user_hash = MiniFB.call(FB_API_KEY, FB_SECRET, "Users.getInfo", "session_key"=>@session_key, "uids"=>@uid, "fields"=>User.all_fields)
|
19
|
+
|
20
|
+
Which simply returns the parsed json response from Facebook.
|
21
|
+
|
22
|
+
Some Higher Level Objects for Common Uses
|
23
|
+
----------------------
|
24
|
+
|
25
|
+
Get a MiniFB::Session:
|
26
|
+
|
27
|
+
@fb = MiniFB::Session.new(FB_API_KEY, FB_SECRET, @fb_session, @fb_uid)
|
28
|
+
|
29
|
+
With the session, you can then get the user information for the session/uid.
|
30
|
+
|
31
|
+
user = @fb.user
|
32
|
+
|
33
|
+
Then get info from the user:
|
34
|
+
|
35
|
+
first_name = user["first_name"]
|
36
|
+
|
37
|
+
Or profile photos:
|
38
|
+
|
39
|
+
photos = user.profile_photos
|
40
|
+
|
41
|
+
Or if you want other photos, try:
|
42
|
+
|
43
|
+
photos = @fb.photos("pids"=>[12343243,920382343,9208348])
|
44
|
+
|
45
|
+
Support
|
46
|
+
--------
|
47
|
+
|
48
|
+
Join our Discussion Group at: http://groups.google.com/group/mini_fb
|
49
|
+
|
data/lib/mini_fb.rb
CHANGED
@@ -20,7 +20,7 @@ module MiniFB
|
|
20
20
|
class FaceBookError < StandardError
|
21
21
|
# Error that happens during a facebook call.
|
22
22
|
def initialize( error_code, error_msg )
|
23
|
-
|
23
|
+
super("Facebook error #{error_code}: #{error_msg}" )
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
data/test/mini_fb_tests.rb
CHANGED
@@ -1,26 +1,29 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
class MiniFBTests < Test::Unit::TestCase
|
3
|
-
|
4
|
-
def setup
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
1
|
+
require 'test/unit'
|
2
|
+
class MiniFBTests < Test::Unit::TestCase
|
3
|
+
|
4
|
+
def setup
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def teardown
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
# Test signature verification.
|
13
|
+
def test_signature
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_basic_calls
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_session
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_photos
|
26
|
+
|
27
|
+
end
|
28
|
+
|
26
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_fb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-13 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|