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?
Related
I'm creating a telegram bot in ruby , right now I'm using long polling , but I wanna change to webhooks, but I'm only found information about creating webhooks in rails , so I don't know if is possible to set a webhook in a ruby only project.
Anyone did this? or have a tutorial? Maybe a lighter application in sinatra or rails api mode?
You could start with a simple socket server: https://ruby-doc.org/stdlib-1.9.3/libdoc/socket/rdoc/Socket.html
However, creating a Rails app with one route for the web hook will not take you a lot of time. This will also give you a lot of flexibility to do more with your inbound data and app in the future e.g. admin dashboard, security, background processing, etc.
I would like to include some common multiplayer elements in my libgdx game. The first step is to have some sort of authentication with my web server. Unfortunately it looks like libgdx does not support HTTPS so how can I let my user login without a secure connection? The user could pretty easily look at the HTTP traffic and hack the game with some other HTTP client. Is there an easy answer or do I have to use platform specific implementations?
I am developing an API for a social network website. This API will basically get all the requests from the users (get friend list, post a status update etc) and reply back if necessary.
We will implement OAuth 2.0 protocol for authentication. Consumer (our php project) has API id and secret.
Basic scenario:
Client wants to log in
API Consumer (php web project) takes this request, directs user to API
User send his/her user credentials to the api, gets the token.
User comes back to our website, pass token to the consumer.
Consumer goes to the api server, gets the access token.
Now consumer (php project) has access to user's private information.
Since this is a social network website, we want app developers to be able to use our API in the future.
I am not experienced in API-design. Does that flow make sense? I guess the simplest authentication would be accessing user information through php project. But we don't want to access database in php code. We will use ajax in client side and send a request to the API. And I believe there should be a better solution, what would you suggest?
Sure, API design is basically point where you need to choose technology.
Either it can be PHP or .net or Java.
I would prefer either PHP or .Net as we get lot of flexibility in it.
API will return XML or Json depending upon the request.
There are lot of CMS in php which can be helped.
.net we have Service Stack to help you.
API's had to be fully independent from other world as well as within API method as well.
If you are able to achieve this, then you will surely create a good architecture.
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.
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.