README.md in omniauth-twitter-1.0.1 vs README.md in omniauth-twitter-1.1.0
- old
+ new
@@ -1,18 +1,22 @@
# OmniAuth Twitter
+[](http://badge.fury.io/rb/omniauth-twitter)
+[](http://travis-ci.org/arunagw/omniauth-twitter)
+[](https://codeclimate.com/github/arunagw/omniauth-twitter)
+
This gem contains the Twitter strategy for OmniAuth.
Twitter offers a few different methods of integration. This strategy implements the browser variant of the "[Sign in with Twitter](https://dev.twitter.com/docs/auth/implementing-sign-twitter)" flow.
-Twitter uses OAuth 1.0a. Twitter's developer area contains ample documentation on how it implements this, so if you are really interested in the details, go check that out for more.
+Twitter uses OAuth 1.0a. Twitter's developer area contains ample documentation on how it implements this, so check that out if you are really interested in the details.
## Before You Begin
You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/intridea/omniauth) to get started.
-Now sign in into the [Twitter developer area](http://dev.twitter.com) and create an application. Take note of your Consumer Key and Consumer Secret (not the Access Token and Secret) because that is what your web application will use to authenticate against the Twitter API. Make sure to set a callback URL or else you may get authentication errors. (It doesn't matter what it is, just that it is set.)
+Now sign in into the [Twitter developer area](https://dev.twitter.com) and create an application. Take note of your API Key and API Secret (not the Access Token and Access Token Secret) because that is what your web application will use to authenticate against the Twitter API. Make sure to set a callback URL or else you may get authentication errors. (It doesn't matter what it is, just that it is set.)
## Using This Strategy
First start by adding this gem to your Gemfile:
@@ -28,15 +32,15 @@
Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
- provider :twitter, "CONSUMER_KEY", "CONSUMER_SECRET"
+ provider :twitter, "API_KEY", "API_SECRET"
end
```
-Replace CONSUMER_KEY and CONSUMER_SECRET with the appropriate values you obtained from dev.twitter.com earlier.
+Replace `"API_KEY"` and `"API_SECRET"` with the appropriate values you obtained [earlier](https://apps.twitter.com).
## Authentication Options
Twitter supports a [few options](https://dev.twitter.com/docs/api/1/get/oauth/authenticate) when authenticating. Usually you would specify these options as query parameters to the Twitter API authentication url (`https://api.twitter.com/oauth/authenticate` by default). With OmniAuth, of course, you use `http://yourapp.com/auth/twitter` instead. Because of this, this OmniAuth provider will pick up the query parameters you pass to the `/auth/twitter` URL and re-use them when making the call to the Twitter API.
@@ -58,11 +62,11 @@
Here's an example of a possible configuration where the the user's original profile picture is returned over https, the user is always prompted to sign-in and the default language of the Twitter prompt is changed:
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
- provider :twitter, ENV["TWITTER_KEY"], ENV["TWITTER_SECRET"],
+ provider :twitter, "API_KEY", "API_SECRET",
{
:secure_image_url => 'true',
:image_size => 'original',
:authorize_params => {
:force_login => 'true',
@@ -96,12 +100,12 @@
},
:extra => {
:access_token => "", # An OAuth::AccessToken object
:raw_info => {
:name => "John Q Public",
- :listed_count" => 0,
- :profile_sidebar_border_color" => "181A1E",
+ :listed_count => 0,
+ :profile_sidebar_border_color => "181A1E",
:url => nil,
:lang => "en",
:statuses_count => 129,
:profile_image_url => "http://si0.twimg.com/sticky/default_profile_images/default_profile_2_normal.png",
:profile_background_image_url_https => "https://twimg0-a.akamaihd.net/profile_background_images/229171796/pattern_036.gif",
@@ -150,21 +154,14 @@
[")](http://railscasts.com/episodes/241-simple-omniauth-revised)
## Supported Rubies
-OmniAuth Twitter is tested under 1.8.7, 1.9.2, 1.9.3 and Ruby Enterprise Edition.
+OmniAuth Twitter is tested under 1.9.3, 2.0.0, 2.1.0, JRuby, and Rubinius.
-[](http://travis-ci.org/arunagw/omniauth-twitter)
+## Contributing
-## Note on Patches/Pull Requests
-
-- Fork the project.
-- Make your feature addition or bug fix.
-- Add tests for it. This is important so I don’t break it in a future version unintentionally.
-- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-- Send me a pull request. Bonus points for topic branches.
+Please read the [contribution guidelines](CONTRIBUTING.md) for some information on how to get started. No contribution is too small.
## License
Copyright (c) 2011 by Arun Agrawal