gosquared / flutter Goto Github PK
View Code? Open in Web Editor NEWTwitter OAuth module for Node.js
Twitter OAuth module for Node.js
Am using MongoDB for my data storage. When I implement flutter, and try to run node instance, it throws error saying -
events.js:72
throw er; // Unhandled 'error' event
^
Error: Redis connection to localhost:6379 failed - connect ECONNREF
USED
at RedisClient.on_error (C:\TF\node_modules\flutter\node
_modules\redis\index.js:189:24)
at Socket. (C:\TF\node_modules\flutter\node_m
odules\redis\index.js:95:14)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:415:13)
npm ERR! weird error 8
npm ERR! not ok code 0
Can someone give me the solution to this..
I just want to get oauthAccessToken and oauthAccessTokenSecret form flutter.
I copied the sample code from the readme and got this error:
/Users/joshuabalfour/Projects/iot-project/node_modules/flutter/src/Flutter.js:128
req.session.oauthRequestToken = token;
^
TypeError: Cannot set property 'oauthRequestToken' of undefined
at /Users/joshuabalfour/Projects/iot-project/node_modules/flutter/src/Flutter.js:128:35
at /Users/joshuabalfour/Projects/iot-project/node_modules/flutter/node_modules/oauth/lib/oauth.js:551:7
at passBackControl (/Users/joshuabalfour/Projects/iot-project/node_modules/flutter/node_modules/oauth/lib/oauth.js:390:11)
at IncomingMessage.<anonymous> (/Users/joshuabalfour/Projects/iot-project/node_modules/flutter/node_modules/oauth/lib/oauth.js:409:9)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
I fixed it by requiring and using express-session in my app
on https://github.com/gosquared/flutter/blob/master/src/Flutter.js#L33 the error coming from Twitter is lost. Any suggestions on how we can get the lib to return errors coming from Twitter? This would make it easier to debug stuff on the Twitter side. Meanwhile, I'll do some testing.
The following example from the documentation is incorrect.
//incorrect
flutter.API.get('search/tweets.json', { q: 'bacon' }, accessToken, secret, function(err, results) {
console.log(results); // { statuses: [ { ...etc } ] }
});
As per the source code, the second argument that the get function expects is the access token.
FlutterAPI.prototype.get = function(url, token, secret, cb)
whereas, what is being provided is a json object. The correct way is as follows
//correct url
flutter.API.get('https://api.twitter.com/1.1/search/tweets.json?q=bacon', accessToken, secret, function(err, results) {
console.log(results); // { statuses: [ { ...etc } ] }
});
I am guessing that what you documented is how you would want to build your library, but that is not how the library currently works. Could you please confirm this is an issue? If so, I shall fix the documentation appropriately.
I'd happily help implement this feature after a quick overview conversation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.