Open Ivanislost opened 5 years ago
I can't run the tweet counter on the terminal either. I'm getting a different error. I've double checked my code and installed express on the directory. I'm also getting a message that ntwitter is unmaintained, so maybe that's the issue.
I've come across a connection issue I have been unable to resolve. I've tried various different methods which I either found online or thought of myself. I will first show the Error code from my terminal, after that I will mention what I have tried and what my setup is.
The error at running twitter.js (I've named it twitter.js in stead of tweet_counter.js)
My js code looks exactly like the example in the book on page 197. I have learned that the status error 401 is thrown when there are authorization issues, OR at other non-described moments (according to Twitter API).
Differences in setup: -I have installed node packages locally in the twitter folder because I had errors installing Express. (I first ran npm init, followed by npm install express) -I run Ubuntu 16.04 -I run virtual box 5.2 (instead of 6)
A couple of methods I have tried: -Using different twitter API's instead of ntwitter (such as 'twitter' and 'twit') -Creating an object variable containing the authorization codes and used that to initialize my twitter -Solely ran the twitter creation line (without the stream), which gave no errors. -I have double triple quadruple checkefd the auth codes and its var names. -Used a different statement instead of statuses/filter and track :.
Unfortunately I have broken my head trying to solve this for a couple of hours, I enjoyed trying to figure out what the issue is, but I will continue without using this example nor the subsequent practice exercises using this example. Never the less I would like to see if anyone could find a solution. I would love to experiment using the twitter API
Thank You!
My js and json file are followed.
credentials.json