Created
June 17, 2015 09:24
-
-
Save codewithpassion/235d244ea2ed9efb7f30 to your computer and use it in GitHub Desktop.
A little twitter bomb script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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