Skip to content

Instantly share code, notes, and snippets.

@fedejordan
Created February 25, 2018 18:15
Show Gist options
  • Save fedejordan/c35d91dcb99c84f2cc6f5b6fafc215ac to your computer and use it in GitHub Desktop.
Save fedejordan/c35d91dcb99c84f2cc6f5b6fafc215ac to your computer and use it in GitHub Desktop.
Blog04 - NodeJS script for relevant tweets
require('dotenv').load();
var Twitter = require('twitter');
var client = new Twitter({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
bearer_token: process.env.TWITTER_BEARER_TOKEN
});
client.get('search/tweets', {q: '#ios #swift'}, function(error, tweets, response) {
tweets.statuses.forEach(function(tweet) {
console.log("tweet: " + tweet.text)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment