Skip to content

Instantly share code, notes, and snippets.

@codewithpassion
Created June 17, 2015 09:24
Show Gist options
  • Save codewithpassion/235d244ea2ed9efb7f30 to your computer and use it in GitHub Desktop.
Save codewithpassion/235d244ea2ed9efb7f30 to your computer and use it in GitHub Desktop.
A little twitter bomb script
var Twitter = require('twitter');
var loremIpsum = require('lorem-ipsum');
const handle = "@test";
var twitter = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
});
setInterval(
function() {
var lorem = loremIpsum({
count: 1 , // Number of words, sentences, or paragraphs to generate.
units: 'sentences'
});
var text = handle + " ";
if (lorem.length + text.length > 140) {
lorem = lorem.substring(0, 140 - (text.length)); //for the space
}
text = text + lorem;
twitter.post('statuses/update', {status: text}, function(error, tweet, response) {
if (!error) {
console.log(tweet);
}
else {
console.error(error);
}
});
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment