title: Node Twitter API only writing one result in excel spreadsheet
body: <p>I have followed a tutorial and expanded on it to make this twitter bot. It takes the latest 100 tweets from the given twitter account and gives me the dates they were posted when I run the program in terminal. This bit works perfectly.</p>
  
  <p>The 3 lines at the bottom are used to write the data to a spreadsheet although it only gives me one result. I'm wanting to know if there's anything I have done wrong or if there is anything I can add that will give me all the results in the spreadsheet?</p>
  
  <p><strong>This is the code I have written</strong></p>
  
  <pre><code>//API
  var Twit = require('twit');
  
  // Getting the API keys from the config file.
  var config = require('./config');
  var T = new Twit(config);
  
  //getting 5 tweets from the username entered in the top username.
  //can get up to 3200 tweets
  var params = {
    screen_name: 'mascott10',
    count: 100
  }
  
  T.get('statuses/user_timeline', params, gotData);
  
  //function to be triggered when the data is collected.
  function gotData(err, data, response) {
    var tweets = data;
    for (var i = 0; i &lt; tweets.length; i++) {
    console.log(tweets[i].created_at);
  var date_posted =  tweets[i].created_at.toString();
    }
  
    //console.log(data);
  
    //write to file
    var fs = require('fs');
    fs.writeFile("/Users/mikey/Desktop/node/test.xls", date_posted);
  };
  </code></pre>
  
  <p><strong>This is some of the results in terminal</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Z6HWg.png" rel="nofollow noreferrer">terminal view of bot result</a></p>
  
  <p><strong>This is the result in the spreadsheet</strong></p>
  
  <p><a href="https://i.stack.imgur.com/wtxdP.png" rel="nofollow noreferrer">spreadsheet result</a></p>