Comments (8)
From line 251 on lib/twitter.js
it looks like trying to open a twitter stream gives an HTTP error.
Also unrelated but if all of the streams you open will track the same thing regardless of user connecting, just open one stream and broadcast to all users from that.
from ntwitter.
Also unrelated but if all of the streams you open will track the same thing regardless of user connecting, just open one stream and broadcast to all users from that.
Hey, you are totally right, actually I would much prefere to push the unique stream to all user any time the twitter stream got something.
About lib/twitter.js
causing the error, what should I do ?
from ntwitter.
Always listen to the error
event from streams, and from event emitters that might emit it. In this case, listen to it, read what it says. It's probably something with your credentials.
If not, might have something to do with twitter recently updating their API to v1.1, in which case the URLs this module uses would need to be updated.
from ntwitter.
Well, the app is working sometime, and sometime not.
To me (from the C++ world) it looks like memory error or stuff like that.
Credential are fine, as I frequently get all the tweet I want.
When you say you want me to listen to error, do you mind that it is mandatory ? if so, why all the example does not show it ? or am I missing something ?
Thank you,
from ntwitter.
The error is being emitted from when ntwitter tries to open the stream. My guess would be that it's working sometimes because the first few streams you open connect without problems and after a while you'll get rate limited since you never close the previous streams.
I'm also not positive but I think socket.io should give an error if you try to socket.emit()
on a closed connection.
It's not in the examples because the node API for event emitters already say that you should always listen for possible error
events, else they will be thrown.
from ntwitter.
looks pretty straightforward. Going to add the error handling part, which means I have to add it for socket.io AND twitter, right ?
Also, would you mind guide me about streaming the twitter data from one stream and broadcast that to user instead of opening the stream each time I got a connection.
Thank,
from ntwitter.
I'm not sure socket.io emits any error
events. It usually just emits when users connect/disconnect. It might emit errors although I've never encountered one.
Which is a bit inconsistent to what I just said. Just read the API on the modules, they should say if they emit error
events.
to emit to all socket.io connected users
t.stream(
'statuses/filter',
{ track: ['awesome', 'cool', 'rad', 'gnarly', 'groovy'] },
function(stream) {
stream.on('data', function(tweet) {
//console.log(tweet.text);
new_tweet = tweet.text;
io.sockets.emit('new_tweet', new_tweet);
});
}
);
from ntwitter.
Well, after reading and learning, I say lets close that issue :)
Thank for your grateful help !
from ntwitter.
Related Issues (20)
- Does streaming work with 1.1 API? HOT 2
- status/firehose doesn't work HOT 5
- reportSpam doesnt work
- Add additional collaborators? HOT 5
- Update with Media
- Rate Limit Status url is wrong
- showUser doesn't work with numerical usernames
- Is stream.on('end') always called when the connection is closed?
- Issue with the twitter API and ntwitter package
- doing more complex queries
- authorize_url vs. authenticate_url
- Post from multiple accounts
- I get some problems when i use ntwitter HOT 1
- Refresh the track list of a stream HOT 3
- Unspecified 'error' event HOT 2
- Add statuses/lookup entry point
- connect "ECONNREFFUSED" Error.
- Updated Fork (For anyone who needs this library)
- What was this deprecated in favour of?
- Login Twitter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntwitter.