exports.findt = (req, res, next) => {
const token = req.user.tokens.find(token => token.kind === 'twitter');
const T = new Twit({
consumer_key: process.env.TWITTER_KEY,
consumer_secret: process.env.TWITTER_SECRET,
access_token: token.accessToken,
access_token_secret: token.tokenSecret
});
T.get('https://api.twitter.com/1.1/users/search.json?q=Twitter%20API&page=1&count=3', (err, reply) => {
if (err) { console.log(err) }
res.status(res).json(reply);
});
};