Test ruby/rails facebook api - ruby

Are there any ruby gems that mock out the requests and responses against the Facebook Graph Api? I would start using fakeweb but I feel as though this may have been done.

Related

Ruby Facebook API integration for OAuth and Game requests.

I'm building a cross platform multi-player game and want to be able to make player requests through Facebook. The approach I would like to take is to have my own web service in the Ruby Sinatra framework which will act as a web service to my numerous game clients.
Is there a current ruby Facebook library/API that would work with Sinatra and allow me to do authorizations, requests, and post notifications to user's timelines?

OmniAuth/OAuth Authentication from a ruby script

Is there a way I can test out the OmniAuth authentication from a standalone ruby script?
Every resource I could find on web lists its usage only in Rails project.This link too: http://www.omniauth.org/
In other words I could not find any client like this FitGem. The fitbit API uses Oauth authentication.FitGem is a client inteface to test out the authentication/authorization to FitBit using OAuth token.
More details here on FitGem: http://www.fitbitclient.com/guide/getting-started
Thanks.
I realize this is old, but I came across it whilst googling so others might also. Maybe this will help the next passerby...
To answer the question - no, it isn't possible to use OmniAuth within a simple, standalone script. What froderik said is correct, OmniAuth was designed to be used within an app on a rack-based framework (Rails, Sinatra, Pakyow, etc.).
To expand on that just a bit though, OmniAuth relies on the ability to intercept and send HTTP requests to/from your app. By default, OmniAuth intercepts requests to /auth/:provider to kickoff the authorization process and will then send callbacks to either /auth/:provider/callback or /auth/failure depending on the outcome of the auth attempt.
Obviously, that functionality is beyond the scope of a standalone script. But if I were to recommend a solution for writing a quick test using OmniAuth, I'd recommend Sinatra. It's certainly not the only solution (any rack-based framework will do), but it provides the needed functionality with minimal overhead.

Ruby gem for Salesforce Soap Api

There are couple of gems for Salesforce Rest Api and Bulk Api. Is there any gem for Salesforce SOAP Api?
https://rubygems.org/gems/databasedotcom
This Gem provides ActiveRecord-like access to Salesforce objects. I've had good luck
with it. It abstracts the SOAP/REST protocol.
After couple of try outs, I settled for Savon Gem.

how to interpret google api oauth callback

i'm attempting to gain access to my own gmail account via a sinatra app i'm building. i'm sending a request to the google api in the form of
https://accounts.google.com/o/oauth2/auth?response_type=code&&scope=https://mail.google.com/+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile&client_id=XXXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=http://localhost:9393/oauth2callback&access_type=online
and after I authorize the app via google's web interface, i'm getting what appears to be a correct callback to my own sinatra app. I'm unclear what I do next in this process. what i'm getting from the google auth system looks like
http://localhost:9393/oauth2callback?code=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
I'm then attempting to use the xoauth gem to then query google for information about my account, ie, https://github.com/nfo/gmail_xoauth
My hope is that the xxxxxx.yyyy string above corresponds in some way to value of
:token as written in the xoauth gem documentation. when I run a local script to check if things are working correctly, i'm getting a Invalid credentials (Failure) (Net::IMAP::NoResponseError)
the documentation i'm using to understand the oauth process is https://developers.google.com/accounts/docs/OAuth2WebServer
i don't think i'm handling the callback correctly or either i'm misinterpreting what it is.
Thoughts?
Google has only added support for OAuth 2 authorization for GMail IMAP/SMTP recently. The library you are using however does not support this yet.
So your options are:
Improving the library yourself (would be my recommendation)
Waiting for the library to update
Falling back to the already deprecated OAuth 1

How to Generate twitter oauth_signature in Ruby

How to Generate twitter oauth_signature in Ruby, I am not using any library like(Oauth, Twitter, twitter_oauth)
Your question is quite ambiguos.
You should start by reading Twitter dev's documentation on OAuth. There's even an example there with the OAuth gem. I used this gem for my code too and was able to authenticate with Twitter's API. After trying out some solution, come back for more specific questions.
I made a small twitter command line app: you can have a look at the code to see a more complex example.

Resources