Hey Everyone,
I was working through the Random Quote project and I took a look at the code for a few users who already did the project. Using a tutorial I can easily create a webpage with a button that will generate random quotes from an array I created in the .js file. I wanted to then start adding some of the Twitter API functionality, but I noticed when I am looking at other people’s code, it doesn’t seem to match mine at all. For example, I have the following in my .js file.
console.log('The bot is starting');
var Twit = require('twit');
var T = new Twit({
consumer_key: '1VgAIE9NyzA8svHnCRpabX44V',
consumer_secret: 'VXVvmfBGCjSLXIiPs8Z6jWrZ4fz2rgMbpxaKe7tMksLYSwcYwp',
access_token: '857362421156937728-EfaOOXeFX96kTN02YTmP2dLtkZWNP0I',
access_token_secret: 'YbKSazGcNCesfAQBTM9Ou1myaZeORMQhd9m9NV8xsV7nc',
})
T.get('search/tweets', { q: 'banana since:2011-07-11', count: 100 }, function(err, data, response) {
console.log(data)
})
I don’t see anything that even looks like this in other solutions. I am pretty sure with this .js file it should get tweets that reference bananas and then print out the data. I created an NPM account and then downloaded twit and tried to use the provided documentation.Is anybody else trying to do the project like this?
Thanks,