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.
Related
First off let me state this is HOMEWORK for school. I am looking for general ideas and direction, not "this is exactly what to write". We did not really cover API's so I am trying to learn as I go.
I have been asked to design an API that can be used with Facebook, for things like posting on my feed or adding new friends. I have been doing tutorials online and most seem to have me add some "ruby gem" that has whatever websites methods and stuff. For example I did a Twilio.com demo that needed require 'twilio-ruby' and a twitter one that needed require 'twitter'. To my understanding, these are "gems" and not "API's" correct? That being said, is Koala an API or a simply a gem that contains the methods I need for writing an API (specifically for Facebook)? If I were to use Koala and it was an API, I feel that would sort of defeat the purpose of writing an API (just reusing their methods and such).
Any other ruby API Facebook help would be greatly appreciated!
Have a look at https://developers.facebook.com/docs/other-sdks Koala is listed as "other" SDK, meaning that it provides a wrapper around the low-level Facebook Graph API requests. So, no, it's not an own (web) API IMHO.
In a narrower interpretation, an API is just an "application programming interface". This would not necessarily have to deal with being accessible for example via a REST interface. I think it depends on the definition of API, respectively what you professor expects. If this is unclear, I'd check back with him/her.
Check
http://en.wikipedia.org/wiki/Api
http://en.wikipedia.org/wiki/Web_API
http://en.wikipedia.org/wiki/Representational_state_transfer
I want to make a "sign in with twitter /facebook" web apps with codeigniter . It seems everybody suggest me to use https://github.com/philsturgeon/codeigniter-oauth2 library.
Is there any complete tutorial using that library ? or any alternative library with complete tutorial to use it?
A3M sounds like something you could use. It has normal user authentication, facebook, twitter, google, yahoo and openid.
Give it a try to see if it has what you need.
https://github.com/donjakobo/A3M
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.
I have been attempting to get the twitter trends but I am unsure of how to do this with json. I also have not found any good tutorials that I am able to follow to accomplish this successfully. As of now, I have been using Hammock to get my statuses, mentions, etc. Are there any tutorials that completely describe how to do this?
The best way is using the Twitter Official API (JSON). You can see the example.
Anyway, I found a link that may help you: Windows Phone 7 – Asynchronous Programming.
All you have to do is use this API method, with an unauthenticated HTTP request.
Given that you are a beginner, here are some starting tips:
How to perform a HTTP request
Parsing JSON with JSON.NET
So far I've come across the following Facebook API libraries for Ruby/Ruby-on-Rails:
Facebooker
Koala
Mogli
Facebooker2
fb_graph
facebook_oauth
I was wondering if anyone knows why there are so many, and if anyone has a rough idea of which to use when?
I did the same search recently and ultimately chose Koala. Facebooker was the clear choice a couple years ago, but it's out of date now with so many recent facebook api changes. Koala and fb_graph seem to be the most popular now. Koala is easy to use for accessing the graph api. I haven't used it for the older rest api, though Koala does support it. The only difficult part I've found is the facebook authentication with oauth - though that's probably facebook itself rather than Koala.
Relevant discussion here as well: Is fb_graph or Koala ruby gem better than facebooker2, using the facebook graph?
I have had the same problem : "which one to use ?" and i tried Facebooker, Mogli and fb_graph.
I can say that fb_graph is the best and the most mature and up to date and well documented ( you can read the facebook DOC and apply it to fb_graph. it works like magic).