Skip to content

Instantly share code, notes, and snippets.

@godfreyd godfreyd/twitter.js
Last active Jul 4, 2017

What would you like to do?
var Twitter = require('twitter');
module.exports = function getContent(config, params) {
return new Promise(function(resolve, reject) {
new Twitter(config).get('search/tweets', params, function(err, data) {
if (err) return reject(err);
if(!data.statuses.length) return resolve({});
nextPageId: data.statuses[data.statuses.length -1].id,
tweets: {
var user = item.user;
return {
time: item.created_at, // UTC time
q: params.q,
url: '' + user.screen_name + '/status/' + item.id_str,
avatar: user.profile_image_url,
message: item.text,
service: 'twitter'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.