title: TypeError: "callback" argument must be a function
body: <p>So I'm following a guide to upload images to twitter w node using twit.</p>
  
  <p>This is my code</p>
  
  <pre><code>    function upload_random_image(){
    console.log('Opening an image...');
    var image_path = path.join(__dirname, '/random_cam/' + random_cam()),
        b64content = fs.readFileSync(image_path, { encoding: 'base64' });
  
    console.log('Uploading an image...');
  
    T.post('media/upload', { media_data: b64content }, function (err, data, response) {
      if (!err){
        console.log('ERROR');
        console.log(err);
      }
      else{
        console.log('Uploaded an image!');
  
        T.post('statuses/update', {
          media_ids: new Array(data.media_id_string)
        },
          function(err, data, response) {
            if (!err){
              console.log('Error!');
              console.log(err);
            }
            else{
              console.log('Posted an image!');
            }
          }
        );
      }
    });
  }
  </code></pre>
  
  <p>Maybe I'm missing something with the callback function, I know if had to be a function but I can't see why my func is not working.</p>
  
  <p>Error:</p>
  
  <pre><code>throw new TypeError('"callback" argument must be a function');
  </code></pre>
  
  <p>Full code:</p>
  
  <pre><code>var Twit = require('twit')
  
  var fs = require('fs'),
      path = require('path'),
      Twit = require('twit'),
      config = require(path.join(__dirname, 'config.js'));
  
  
  var T = new Twit(config);
  
  function random_cam(){
    var random_pic = [
      '1.jpg',
      '2.jpg',
      '3.jpg'
    ];
    return random_pic[Math.floor(Math.random() * random_pic.length)];
  }
  
  
  function upload_random_image(){
    console.log('Opening an image...');
    var image_path = path.join(__dirname, '/random_cam/' + random_cam()),
        b64content = fs.readFileSync(image_path, { encoding: 'base64' });
  
    console.log('Uploading an image...');
  
    T.post('media/upload', { media_data: b64content }, function (err, data, response) {
      if (err){
        console.log('ERROR');
        console.log(err);
      }
      else{
        console.log('Uploaded an image!');
  
        T.post('statuses/update', {
          media_ids: new Array(data.media_id_string)
        },
          function(err, data, response) {
            if (err){
              console.log('Error!');
              console.log(err);
            }
            else{
              console.log('Posted an image!');
            }
          }
        );
      }
    });
  }
  
  setInterval(
    upload_random_image(),
    10000
  );
  </code></pre>
  
  <p>Complete error:</p>
  
  <pre><code>Opening an image...
  Uploading an image...
  timers.js:414
      throw new TypeError('"callback" argument must be a function');
      ^
  
  TypeError: "callback" argument must be a function
      at exports.setInterval (timers.js:414:11)
      at Object.&lt;anonymous&gt; (/Users/imac/test/server.js:72:1)
      at Module._compile (module.js:571:32)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
      at Function.Module._load (module.js:439:3)
      at Module.runMain (module.js:605:10)
      at run (bootstrap_node.js:420:7)
      at startup (bootstrap_node.js:139:9)
      at bootstrap_node.js:535:3
  </code></pre>