🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

fbk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fbk

bundlerRubyGems.org
Version
1.4.5
Version published
Maintainers
1
Created
Source

FBK

Build Status

Just a bunch of methods that may come in handy when interacting with the Facebook Graph API.

We use this gem at Chicisimo.

Usage

require "sinatra"
require "fbk"

REDIRECT_URI = "https://something.com/login/fb/token"

FBK.configure do |config|
  config.client_id     = "xxx"
  config.client_secret = "xxx"
end

get "/login/fb" do
  redirect to(FBK.authorize_uri(redirect_uri: REDIRECT_URI, scope: %w{public_profile}))
end

get "/login/fb/token" do
  code = params[:code]

  access_token = FBK.get_access_token(redirect_uri: REDIRECT_URI, code: code) # => "xxxx"

  user = FBK.get_user_info(access_token) # => {:id=>"xxxx", :first_name=>"Pedro", :gender=>"male", :last_name=>"GimĂŠnez", :link=>"https://www.facebook.com/pedrotgimenez", :locale=>"en_US", :name=>"Pedro GimĂŠnez", :timezone=>1, :updated_time=>"1955-02-24T00:00:00+0000", :username=>"pedrotgimenez", :verified=>true}

  friends = FBK.get_user_friends(access_token) # => => ["xxxx", "xxxx"]

  picture = FBK.get_user_picture(access_token, type: "square", height: 256) # => {:height=>320, :is_silhouette=>false, :url=>"https://scontent.xx.fbcdn.net/hprofile-xft1/v/t1.0-1/p320x320/xxxx.jpg", :width=>320}
end

FAQs

Package last updated on 20 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts