No Tweets showing up #46

Open
dsinkey opened this Issue Jan 5, 2016 · 12 comments

Projects

None yet

6 participants

@dsinkey
dsinkey commented Jan 5, 2016

I'm about to go to snapkite-engine and run 'npm start and I get the message [Snapkite][Socket] Listening on port 3000.

I'm also about to run gulp and get no errors, but when I open up the index.html file I don't see any photos show and and I get this error in the console. Any suggestions?

Failed to clear temp storage: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. SecurityError

@fedosejev
Owner

@dsinkey try the following:

  1. Run npm install --global http-server.
  2. Navigate to the build/ directory.
  3. Run http-server.
  4. Open http://localhost:8080 in Chrome.
@ayebide
ayebide commented Jan 5, 2016

Hi,

I'm having the same issue btw (re-reading maybe not the same issue but related). All seems to be correct but just no tweets showing. No errors from gulp, no errors in the console and no errors from snapkite on startup. Also I tried running it on a local server as per your note above but still no tweets were returned.

If I wait long enough (5/10 minutes) snapkite eventually stops with the following error. (You can see below I reloaded the page a number of times which successfully disconnected and reconnected also).

ayebide@pixel2:~/dev.local/book-reactessentials/snapkite-engine$ npm start

> snapkite-engine@0.1.2 start /home/ayebide/dev.local/book-reactessentials/snapkite-engine
> node app.js

[Snapkite][Socket] Listening on port 3000
[Snapkite][Socket] Client connected
[Snapkite][Socket] Client connected
[Snapkite][Socket] Client disconnected
[Snapkite][Socket] Client connected
[Snapkite][Socket] Client disconnected
[Snapkite][Socket] Client connected
/home/ayebide/dev.local/book-reactessentials/snapkite-engine/node_modules/node-tweet-stream/lib/twitter.js:9
      throw new Error('Exceeded twitter rate limit')
      ^

Error: Exceeded twitter rate limit
    at null.httpBackoff (/home/ayebide/dev.local/book-reactessentials/snapkite-engine/node_modules/node-tweet-stream/lib/twitter.js:9:13)
    at null.<anonymous> (/home/ayebide/dev.local/book-reactessentials/snapkite-engine/node_modules/node-tweet-stream/lib/twitter.js:236:15)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at Request.onRequestResponse (/home/ayebide/dev.local/book-reactessentials/snapkite-engine/node_modules/request/request.js:951:10)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:305:20)

npm ERR! Linux 3.19.0-11.11+samus-1-generic
npm ERR! argv "/usr/local/bin/node" "/home/ayebide/.node_modules_global/bin/npm" "start"
npm ERR! node v4.0.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! snapkite-engine@0.1.2 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the snapkite-engine@0.1.2 start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the snapkite-engine package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs snapkite-engine
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls snapkite-engine
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ayebide/dev.local/book-reactessentials/snapkite-engine/npm-debug.log
@fedosejev
Owner

@ayebide the problem is due to Twitter API limit. This might help: https://blog.twitter.com/2008/what-does-rate-limit-exceeded-mean-updated

"If people are having limit problems just get them to reset their password (on the twitter website)…Worked well for me when I reset the twitter password."

@ayebide
ayebide commented Jan 5, 2016

@fedosejev Thanks! That actually (mostly) did the trick. The change of password alone didn't fix it but I regenerated the consumerKey/Secret and the accessTokenKey/Secret after as well and that solved it.

Btw huge kudos on the book. I've read a couple of React books now and have found yours by far and away the most useful as it helped to teach the concepts around it not just the syntax.

@fedosejev
Owner

@ayebide happy to help and I really appreciate your feedback. Do you mind if I quote you on my website?

@dsinkey
dsinkey commented Jan 5, 2016

@fedosejev Thank you for getting back so quick. I installed http-server and opened up localhost:8080, but I still didn't get any pictures to show up. This is what was in the server console:

Hit CTRL-C to stop the server
[Tue, 05 Jan 2016 20:01:51 GMT] "GET /" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Tue, 05 Jan 2016 20:01:51 GMT] "GET /snapterest.js" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Tue, 05 Jan 2016 20:01:52 GMT] "GET /favicon.ico" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Tue, 05 Jan 2016 20:01:52 GMT] "GET /favicon.ico" Error (404): "Not found"
[Tue, 05 Jan 2016 20:02:42 GMT] "GET /favicon.ico" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Tue, 05 Jan 2016 20:02:42 GMT] "GET /favicon.ico" Error (404): "Not found"
[Tue, 05 Jan 2016 20:03:14 GMT] "GET /favicon.ico" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
[Tue, 05 Jan 2016 20:03:14 GMT] "GET /favicon.ico" Error (404): "Not found"

I noticed that in ayebide log it says:
[Snapkite][Socket] Listening on port 3000
[Snapkite][Socket] Client connected

I don't get the: [Snapkite][Socket] Client connected line, just the Listening on port 3000.

Thanks again

@fedosejev
Owner

@dsinkey the logs are looking good, I wonder if something else is going on - possibly a case of Twitter API not sending any tweets? Can you regenerate Consumer Key and Secret via https://apps.twitter.com?

@joezcool02

I am also having this issue as @dsinkey , resetting my Twitter password and regenerating the Consumer Key and Secret seems to have fixed it!

and running node app.js in my snapkite-engine fixed it.

however i am now having the same disconnect issues @ayebide was having and i have changed password and regenerated keys twice.

although it does now seem to be working quite well https://gyazo.com/84b2c87de03cf13cc5ae7dab21518e49

rookie mistake maybe if you found here and you weren't running node app.js in the build folder because i forgot to do that up until now.

@dsinkey
dsinkey commented Jan 7, 2016

@joezcool02 what's the command to run node app.js in the build folder?

@joezcool02

@dsinkey "node app.js"
if you check in snapkite-engine/package.json there is a line that should say start, followed by the command to run the server.

@abondar24

How does the app know where to connect for tweets?

@JamesSeabrookBWKZ

I'm getting these issues as well, except I'm not (as yet) getting the twitter time out issues with the API. I have reset my password and API keys etc to no avail. I'm listening on port 3000. I am unable to get this to work through either opening the file directly in the browser or going to localhost:3000 or any other port for that matter. The only report I get back is that it failed to connect (this is from the browser - snapkite in the console doesn't seem to tell me anything.

Any direction would be useful, as this is my first step in this direction. My folder structure is ~/snapkite and ~/snapterest I don't have these in their own folder, could this be part of the issue surrounding it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment