Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da13e52
commit 5446c2f
Showing
1 changed file
with
2 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,61 +1,3 @@ | |||
#About: | # DEPRECATED | ||
|
|||
A simple API to work with twitters new (1.1) API. through oAuth with Express.js and Node.js. | |||
|
|||
|
|||
Requests are cached in Redis for 60 seconds to avoid rate limits if you provide connection details. | |||
|
|||
|
|||
##Installation: | |||
|
|||
npm install twitter-oauth | |||
|
|||
|
|||
##Setup | |||
|
|||
You will need to ensure the following values are set correctly: | |||
|
|||
``` | |||
var twitterAuth = require('twitter-oauth')({ | |||
consumerKey: "ENTER CONSUMER KEY HERE", /* per appication - create a comsumer key here: https://dev.twitter.com/apps */ | |||
domain: 'YOUR DOMAIN HERE', | |||
consumerSecret: "ENTER CONSUMER SECRET FROM TWITTER HERE", /* create a comsumer key here: https://dev.twitter.com/apps */ | |||
loginCallback: "http://yourdomain.com/twitter/sessions/callback", /* internal */ | |||
completeCallback: "http://yourdomain.com/search/beagles" /* When oauth has finished - where should we take the user too */ | |||
}); | |||
``` | |||
|
|||
See examples for more details. | |||
|
|||
|
|||
If a redis port and host are provided then each request will be cached for 60 seconds. | |||
|
|||
###Routes: | |||
|
|||
You will need to set up the routes: | |||
|
|||
``` | |||
app.get('/twitter/sessions/connect', twitterAuth.oauthConnect); | |||
app.get('/twitter/sessions/callback', twitterAuth.oauthCallback); | |||
app.get('/twitter/sessions/logout', twitterAuth.logout); | |||
``` | |||
|
|||
|
|||
Then you can call the service like so: | |||
|
|||
``` | |||
twitterAuth.search(req.params.term.split('|'), req.session.oauthAccessToken, req.session.oauthAccessTokenSecret, function(error, data) { | |||
res.json(data); | |||
}); | |||
``` | |||
|
|||
See the search example to see all the possible searches. | |||
|
|||
Twitter 1.1 | |||
|
|||
Twitter recently announced some changes to its API which resulted in us having to make some changes to our backend social service. | |||
|
|||
While the version number only went from 1 to 1.1 it actually contained some big changes. | |||
|
|||
To ensure our social offering was ready for twitter turning off its 1.0 API we build this library. | |||
|
|
||
Please use https://github.com/gosquared/flutter instead! |