-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twitter API V2.0 public search update #954
base: master
Are you sure you want to change the base?
Conversation
Update the public search and user look up parts to work with twitter API V2.0
Added bearer token to support API V2.0
You should not check in the You also need to sign the CLA so we can accept the changes. |
} else { | ||
self.warn("Failed to get user profile"); | ||
|
||
const needle = require('needle'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see here you are using needle
however needle
is not a dependency in this package (request
is a dependency).
I am not against using needle
(in fact it is a reasonable alternative considering request
is depreciated) BUT for me to accept this PR, I would suggest the rest of the HTTP requests are changed to use needle
as well.
If you can do that - great.
PS, you would also need to add a dependency in the package.json for needle
} | ||
// Listen to the stream. | ||
// node.status({fill:"green", shape:"dot", text:(node.tags||" ")}); | ||
console.log("Twitter API is steraming public tweets with search term " + node.tags || " "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the project to upgrade to Twitter 2.0. Would be great to keep the logging consistent with the old node, and avoid console.log() throughout, so node.debug maybe here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, I will change it.
var params = msg.params || {}; | ||
params.status = msg.payload; | ||
if (mediaId) { | ||
params.media_ids = mediaId; | ||
} | ||
node.twitterConfig.post("https://api.twitter.com/1.1/statuses/update.json",{},params).then(function(result) { | ||
node.twitterConfig.post("https://api.twitter.com/1.1/statuses/update.json", {}, params).then(function (result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is this mix of twitter 1.1 for the Twitter Out node, and 2 for the Twitter in node. It would be fantastic to have them both on Twitter 2. At the moment if I use this branch and deploy first a twitter in, and then a twitter out node I get an exception I think because the two configurations of credentials clash 24 Oct 22:45:40 - [info] Updated flows 24 Oct 22:45:40 - [red] Uncaught Exception: 24 Oct 22:45:40 - [error] Error: aborted at connResetException (node:internal/errors:705:14) at TLSSocket.socketCloseListener (node:_http_client:454:19) at TLSSocket.emit (node:events:525:35) at node:net:301:12 at TCP.done (node:_tls_wrap:588:7)
Might want to wait until after the 9th to see what API is still available and at what cost... |
Hi all I was wondering if there is any update as to weather or not this is going to be merged into master or is there a timeline on this? @shahramdj did you manage to get this running with the current version 2 of the twitter API? Or have you reverted back to using a function node to get your tweets out to the world? |
Proposed changes
Current twitter node does not search public tweets since twitter has upgraded the API to V 2.0. The change that I made solves the problem.
Checklist
grunt
to verify the unit tests pass