Skip to content

Instantly share code, notes, and snippets.

@hammertoe
Created June 15, 2020 21:03
Show Gist options
  • Save hammertoe/68966e80b3e2ac7e6c77601143282360 to your computer and use it in GitHub Desktop.
Save hammertoe/68966e80b3e2ac7e6c77601143282360 to your computer and use it in GitHub Desktop.
app.get('/tweets',
require('connect-ensure-login').ensureLoggedIn(),
function(req, res) {
var T = new Twit({
consumer_key: process.env['TWITTER_CONSUMER_KEY'],
consumer_secret: process.env['TWITTER_CONSUMER_SECRET'],
access_token: req.user.token,
access_token_secret: req.user.tokenSecret,
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
strictSSL: true, // optional - requires SSL certificates to be valid.
})
T.get('statuses/home_timeline', { count: 20,
tweet_mode: 'extended' },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment