Get Facebook friends by Json request in Ruby on Rails
Below is the code to return all your facebook friends by passing oauth token:-
response = Net::HTTP.get_response(URI("https://graph.facebook.com/v2.5/me/friends?access_token=#{oauth_token)}"))
unless response.is_a?(Net::HTTPSuccess)
return nil
end
json = ActiveSupport::JSON.decode(response.body)
json['summary']['total_count'].to_s + ' Friends'
Comments
Post a Comment