Twitter bot image posting bug
<p>Ok so I've had a lot of fun setting up a twitterbot through these tutorials and I have had no problems up to image posting. I have been following along these tutorials: <a href="https://www.youtube.com/playlist?list=PLRqwX-V7Uu6atTSxoRiVnSuOn6JHnq2yV" rel="nofollow noreferrer">https://www.youtube.com/playlist?list=PLRqwX-V7Uu6atTSxoRiVnSuOn6JHnq2yV</a> and was stuck on 15.6 (<a href="https://www.youtube.com/watch?v=mUoIPmZ4KwA" rel="nofollow noreferrer">https://www.youtube.com/watch?v=mUoIPmZ4KwA</a>) where we post images. It's takes kind of a while to watch all of it but you might be able to skip the simple tweeting text and follow response videos.  Now, I understand about 80% of what this guy is saying, as I am a little new to JS compared to some of you guys who are much more experienced than me, so some of my code is a little repetitive, but I wanted to make sure everything runs.</p>

<pre><code>var imageTweet = function(txt) {

    var tweet = {
        status:txt
    }

    //This is for uploading the image to twitter but not actually tweeting it
    //Might want to define the b64_img
    var b64_img = 0;
    var imageProcessing = function(){

        var filename = "dankykang.jpg";
        var params_img = {
            encoding:'base64'
        }
        b64_img = fs.readFileSync(filename, params_img)

    }
    imageProcessing();

    var upload_params = {
        media_data: b64_img
    }

    T.post('media/upload', upload_params, tweeted_img);

    function upload_img(err, data, response){

        //This part does the tweet
        var id = data.media_id_string;
        var tweet = {
            //for text in the image tweet 
            status:"testing a new way to tweet an image...",
            //This calls the image from the imageProcessing function
            media_ids:[id]
        }
        T.post('statuses/update', tweet, imgstatustweeted);
        function imgstatustweeted(){
            if (err){
                console.log("The status didn't work")
            } else {
                console.log("Status worked")
            }
        }
        imgstatustweeted();
    }
    upload_img();

    function tweeted_img(err, data, response){
        if (err){
            console.log("Image not posted");
        } else {
            console.log("Image posted");
        }
    }
    tweeted_img();
}
imageTweet();
</code></pre>

<p>I follow most of his steps with some name changes, and I don't think I am missing anything... but when I run bot.js it keeps giving me an error on data.media_id_string; [above var tweet = {...} and below function upload_img(...)]</p>

<p>it says TypeError: Cannot read property 'media_id_string' of undefined. But according to the tutorial I'm following, I think this has to to with the npm which was set up. So I don't know why it runs fine on his end but doesn't run fine on my end. If I'm not mistaken its not a syntax problem.</p>