fbrails 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fbrails/graph.rb CHANGED
@@ -7,6 +7,28 @@ module Fbrails
7
7
  @token = token
8
8
  end
9
9
 
10
+
11
+
12
+ def friends
13
+ result = []
14
+ friends = Fbrails.get(URL+"me"+"/"+"friends"+access_token)
15
+ loop do
16
+ if friends.has_key?("paging") && friends["paging"].has_key?("next")
17
+ unless friends["data"].blank?
18
+ friends["data"].each do |fr|
19
+ fr["id"] = fr["id"].to_i
20
+ result << fr
21
+ end
22
+ end
23
+ else
24
+ return result
25
+ end
26
+ friends = Fbrails.get(friends["paging"]["next"])
27
+ end
28
+ end
29
+
30
+
31
+
10
32
  # def get_object(obj = "")
11
33
  # url = "https://graph.facebook.com/me/#{obj}?access_token=#{@token}"
12
34
  # Fbrails.get(url)
@@ -1,3 +1,3 @@
1
1
  module Fbrails
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-24 00:00:00.000000000Z
14
+ date: 2011-10-26 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httpclient
18
- requirement: &11991780 !ruby/object:Gem::Requirement
18
+ requirement: &14302580 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: 2.2.2
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *11991780
26
+ version_requirements: *14302580
27
27
  description: Small gem for auth & getting info from facebook
28
28
  email:
29
29
  - donotsendhere@gmail.com