Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3307698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:26:10+00:00 2026-05-17T21:26:10+00:00

I am working on integrating Omniauth with my new Facebook application, and I am

  • 0

I am working on integrating Omniauth with my new Facebook application, and I am looking through the rather sparse documentation to understand if it gives simple ways to access the graph API… I am moving from Koala which was pretty simple.

Has anyone out there used Omniauth for this yet? I want to get photos from the users’ albums, and sort and get the unique URLs for them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:26:11+00:00Added an answer on May 17, 2026 at 9:26 pm

    So I wasn’t able to get fb_graph to work properly – I am still a noob having been a Ruby On Rails developer for a total of about 8-10 weeks, and therefore don’t have an instinct for what must be obvious problems to other folks.

    However I found this great little blog post which outlines a simple facebook client and shows clearly how it all plugs together. I found an issue with it picking up the me/picture object as Facebook returns an http302 not http200 but that was easily worked around with the help of the author. Check it out: http://bnerd.de/misc/ruby-write-basic-client-for-facebook-graph-api/

    I am now using Omniauth for the simplicity of the login/signup interaction based on this walkthrough here: blog.railsrumble.com/blog/2010/10/08/intridea-omniauth and with the token I get from that I am using this simple FBClient from the bnerd reference above to access the Graph API. Hope what I found helps others.

    …here’s my version of bnerd’s code and it worked for me:

        class FBClient
    
          def initialize(app, access_token = nil)
            @app = app
            @access_token = access_token
          end
    
          # request permission(s) from user
          def request(perms)
            #create a random verifier to identify user on fb callback
            verifier = (0...10).map{65.+(rand(25)).chr}.join
            uri = "https://graph.facebook.com/oauth/authorize?client_id=#{@app.app_id}&redirect_uri=#{@app.connect_url}?verifier=#{verifier}&scope=#{perms}"
    
            request = { :verifier => verifier, :uri => uri }
            return request
    
          end
    
          def connect(code, verifier)
    
            uri = URI.parse("https://graph.facebook.com/oauth/access_token?client_id=#{@app.app_id}&redirect_uri=#{@app.connect_url}?verifier=#{verifier}&client_secret=#{@app.secret}&code=#{CGI::escape(code)}")
            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true
    
            request = Net::HTTP::Get.new(uri.path + "?" + uri.query)
            response = http.request(request)     
            data = response.body
    
            return data.split("=")[1]
          end
    
          # get, post
          def get(path, params = nil)
            uri = URI.parse("https://graph.facebook.com/" + path)
            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true
    
            if params.nil?
              params = Hash.new
            end
    
            if params["access_token"].nil? 
              params["access_token"] = @access_token unless @access_token.nil?
            end
    
            request = Net::HTTP::Get.new(uri.path) 
            request.set_form_data( params )
            request = Net::HTTP::Get.new(uri.path + "?" + request.body)
    
            return response = http.request(request)
          end
    
          def post(path, params = nil)
            uri = URI.parse("https://graph.facebook.com/" + path)
            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true        
    
            if params.nil?
              params = Hash.new
            end
    
            if params[:access_token].nil?
              params[:access_token] = @access_token unless @access_token.nil?
            end
    
            request = Net::HTTP::Post.new(uri.path) 
            request.set_form_data( params )
            request = Net::HTTP::Post.new(uri.path + "?" + request.body)
    
            response = http.request(request)
            response.code == "200" ? feed = JSON.parse(response.body) : raise("Sorry, an error occured. #{response.body}")
            return feed
          end
        end
    

    I am sure someone more experienced than I could improve this – I was about 10 weeks into learning Ruby (and my first programming since Fortran and Pascal at university in the early 90s!).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am integrating OmniAuth Facebook on my site. I had it working but then
I'm working on integrating CAS in a legacy Java application. It's looking promising at
I'm working on integrating Facebook with my iPhone/iOS application and I want to know
I have created a facebook application for integrating facebook credits.It is working fine but
I am working on integrating Assetic into an application that I am building. The
I'm working on a small application and thinking about integrating BLAST or other local
I'm fairly new to coding and just recently started working on integrating functions into
I'm integrating the Facebook Like Button into a site. The likeing functionality is working
I am working on integrating the social network vkontakte into my desktop application using
I'm thinking of integrating a chat inside an already written and working php application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.