Skip to content

Instantly share code, notes, and snippets.

@adityathebe
Created September 15, 2017 14:10
Show Gist options
  • Save adityathebe/778d88d60790c6537b13537c82b63e5a to your computer and use it in GitHub Desktop.
Save adityathebe/778d88d60790c6537b13537c82b63e5a to your computer and use it in GitHub Desktop.
Twitter Bot Tutorial - function that tweets !
const TWIT = require('twit')
const config = require('./config');
var Twit = new TWIT(config);
function makeTweet(tweet) {
Twit.post('statuses/update', { status: tweet }, function(err, data, response) {
if(err) {
console.log(err)
} else {
console.log("Tweet Made Successfully")
}
});
};
tweet("I am tweeting from my command line and it's awesome");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment