0

I'm trying to get a twitter bot to tweet quotes from a text file but I don't know where to start, I managed to get it to tweet with a sentence but now I want to try have a list with quotes for it to tweet at set intervals, cany help would be appreciated, below is the code I used. Do i need to put in something that would link back to a file and what file would I need, text, csv?

console.log('The bot is starting');

var Twit = require('twit');

var config = require('./config');
var T = new Twit(config);

var tweet = {
    status: 'The F1 Pit Wall Test'
}

T.post('statuses/update', tweet, tweeted);

    function tweeted(err, data, response) {
        if (err) {
            console.log("Something went wrong!");
        } else {
            console.log("It worked!");
        }
        
}

I had a look online but can't find anyone doing it using node, cmd and js.

j08691
  • 204,283
  • 31
  • 260
  • 272
  • Does this answer your question? "[Grabbing a random line from file](/q/13392059/90527)", "[How to request a random row in SQL?](/q/19412/90527)", "[How do I select a random object(?) from a JSON file with Javascript?](/q/49684828/90527)", "[How can I get a random record from MongoDB?](/q/2824157/90527)" – outis Nov 16 '22 at 20:03

0 Answers0