Skip to content

Instantly share code, notes, and snippets.

@nhindman
Created April 8, 2014 19:03
Show Gist options
  • Save nhindman/10172181 to your computer and use it in GitHub Desktop.
Save nhindman/10172181 to your computer and use it in GitHub Desktop.
var Twit = require('twit')
var T = new Twit({
consumer_key: 'i7lsLu4dOv66EEDzCWEifyoXd',
consumer_secret: '3I7NQsQsjQpCsadhN8t1Ry9Xb3oglUsDTzME6Cc0EGLvrVmZQB',
access_token: '1067293915-gXahWnpOxPZydxkzAO4YzWNfhaSkZp8Nz6KfW4L',
access_token_secret: '1e8Y0rCaLlz9SkdlIqBuMsBbEJvDY1SUb9ZClh6WNkmim',
});
var tweets = [];
var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/
T.get('statuses/user_timeline', { 'screen_name' : '0xAX', 'count': 100 }, function(err, reply) {
for (i in reply){
tweet = reply[i].text;
if (urlPattern.test(tweet)){
console.log(tweet)
tweets.push(tweet);
}
}
console.log(tweets.length)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment