Node.js Twitter 客户端
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6377844/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Node.js Twitter Client
提问by Johnathan Leppert
Is there a twitter client for node.js (not the streaming API, the regular API)?
是否有用于 node.js 的 twitter 客户端(不是流式 API,常规 API)?
I already know about twitter-nodebut I'm looking for a more generic client that allows use of the Twitter REST API.
我已经知道twitter-node,但我正在寻找一个更通用的客户端,允许使用Twitter REST API。
Anyone have any ideas?
谁有想法?
Thanks,
谢谢,
Johnathan
乔纳森
回答by tez
Check out my node module, it is probably what you're looking for. Has full twitter API support (REST & Streaming API): https://github.com/ttezel/twit
看看我的节点模块,它可能就是你要找的。拥有完整的 twitter API 支持(REST & Streaming API):https: //github.com/ttezel/twit
回答by rsp
2014 Update
2014年更新
A lot has changed since this question was asked over 3 years ago, but this question is still highly ranked on search engines so it's time to add some updates.
自从 3 年前提出这个问题以来发生了很多变化,但这个问题在搜索引擎上的排名仍然很高,所以是时候添加一些更新了。
There are many different Node modules to use with the Twitter API and it is not easy to choose the right one for someone who doesn't know all of them. Below is a short description of all of the currently popular modules, together with their authors, latest version, how many stars on GitHub do they have (which is a good indication of their popularity among GitHub users), how many commits, how many contributors, where were they recommended etc. There are also some useful usage stats on npm.
有许多不同的 Node 模块可以与 Twitter API 一起使用,对于不了解所有模块的人来说,选择正确的模块并不容易。下面是对当前所有流行模块的简短描述,包括它们的作者、最新版本、它们在 GitHub 上有多少颗星(这很好地表明它们在 GitHub 用户中的受欢迎程度)、提交次数、贡献者数量,他们在哪里推荐等。npm上还有一些有用的使用统计信息。
Since it is about Twitter, I?will link to the Twitter profiles of people that I reference. The data is up to date as of 2014-07-29 and isn't meant to be always up to date but rather to show a snapshot in time for various comparisons.
因为它是关于 Twitter 的,我将链接到我引用的人的 Twitter 个人资料。数据截至 2014 年 7 月 29 日是最新的,并不意味着始终是最新的,而是及时显示快照以进行各种比较。
On the official dev.twitter.com/docs/twitter-librariesthere are only two Node modules:
在官方dev.twitter.com/docs/twitter-libraries上只有两个 Node 模块:
TwitterJSClientby @BoyCook
@BoyCook的TwitterJSClient
- (Version 0.0.1, 87★, 2 contributors, 19 commits - last on May 06, 2014) (not available on npm?)
- (版本 0.0.1,87★,2 位贡献者,19 次提交 - 最后于 2014 年 5 月 6 日)(在 npm 上不可用?)
user-streamby @AivisSilins
用户流通过@AivisSilins
- (Version 0.0.7, 57★, 1 contributor, 26 commits - last on Mar 28, 2014) (npm stats)
- (版本 0.0.7,57★,1 位贡献者,26 次提交 - 最后于 2014 年 3 月 28 日)(npm stats)
The articles:
文章:
- Node.js modules you should know about: ntwitterposted on December 09, 2011 by @pkrumins
- Node.js + Twitter Streaming API + Socket.io = Twitter Cashtag Heatmapposted on April 18, 2013 by @thedillonb
- 您应该了解的 Node.js 模块:ntwitter于 2011 年 12 月 9 日由@pkrumins 发布
- Node.js + Twitter Streaming API + Socket.io = Twitter Cashtag Heatmap于 2013 年 4 月 18 日由@thidilonb 发布
both recommend:
两者都推荐:
ntwitterby AvianFlu(no Twitter?) et al.
ntwitter来自AvianFlu(没有 Twitter?)等。
- (Version 0.5.0, 765★, 31 contributors, 245 commits - last on Sep 14, 2012) (npm stats)
- (版本 0.5.0,765★,31 位贡献者,245 次提交 - 最后于 2012 年 9 月 14 日)(npm stats)
The article A Twitter bot in 20 minutes with Node.jsposted on October 3rd, 2013 by @ebertxrecommends:
@ebertx于 2013 年 10 月 3 日发表的文章A Twitter bot in 20 minutes with Node.js推荐:
twitby @tolga_tezel
TWIT通过@tolga_tezel
- (Version 1.1.18, 806★, 11 contributors, 296 commits - last on Jul 21, 2014) (npm stats)
- (版本 1.1.18,806★,11 位贡献者,296 次提交 - 最后于 2014 年 7 月 21 日)(npm stats)
The most popular Twitter modulesaccording to nodejsmodules.orgby @corruptmemare:
根据@corruptmem的nodejsmodules.org,最受欢迎的 Twitter 模块是:
(listing only the relevant ones from the list - eg. skipping blueimp-bootstrap-image-gallery etc.)
(仅列出列表中的相关内容 - 例如跳过 blueimp-bootstrap-image-gallery 等)
everyauthby @briannoguchi
@briannoguchi的everyauth
- (Version 0.4.6, 2822★, 47 contributors, 760 commits - last on Apr 30, 2014) (npm stats)
- (Note: it's a general-purpose authentication module)
- (版本 0.4.6,2822★,47 个贡献者,760 次提交 - 最后于 2014 年 4 月 30 日)(npm stats)
- (注:这是一个通用的认证模块)
ntwitterby AvianFlu(no Twitter?) et al.
ntwitter来自AvianFlu(没有 Twitter?)等。
- (see above)
- (看上面)
twitter-nodeby @technoweenie
Twitter的节点通过@technoweenie
- (Version 0.1.1, 436★, 10 contributors, 65 commits - last on Apr 15, 2012) (npm stats)
- (Note: Discontinued and recommends ntwitter)
- (版本 0.1.1,436★,10 位贡献者,65 次提交 - 最后于 2012 年 4 月 15 日)(npm stats)
- (注:已停产,推荐ntwitter)
node-twitterby @jdub
节点的Twitter通过@jdub
- (forked from twitter-node - see above)
- (on npm called just "twitter")
- (Version 0.1.18, 313★, 9 contributors, 162 commits - last on Mar 10, 2012) (npm stats)
- (从 twitter-node 分叉 - 见上文)
- (在 npm 上称为“twitter”)
- (版本 0.1.18,313★,9 位贡献者,162 次提交 - 最后于 2012 年 3 月 10 日)(npm stats)
twitterlibby @rem
twitterlib通过@rem
- (Version 1.1.4, 289★, 3 contributors, 89 commits - last on Jun 21, 2013) (npm stats)
- (版本 1.1.4,289★,3 位贡献者,89 次提交 - 最后于 2013 年 6 月 21 日)(npm stats)
twitby @tolga_tezel
TWIT通过@tolga_tezel
- (see above)
- (看上面)
This is what I have found to be a list of most popular Node modules to use the Twitter API. Please note that the most popular doesn't necessarily mean the best. All of them have different APIs, popularity, feature sets, authors, documentation, users. It's impossible to recommend only one module but this list should be a good starting point to find the one that is best suited for a particular set of needs.
这是我发现的最流行的使用 Twitter API 的 Node 模块列表。请注意,最受欢迎的并不一定意味着最好的。它们都有不同的 API、流行度、功能集、作者、文档和用户。不可能只推荐一个模块,但是这个列表应该是一个很好的起点,可以找到最适合一组特定需求的模块。
Please comment if there are any mistakes or missing modules or other info that should be added here.
如果有任何错误或缺少模块或应在此处添加的其他信息,请发表评论。
回答by Alfred
Search via http://search.npmjs.org:
https://github.com/jdub/node-twitter
I believe it also supports REST-API and is more up2date(more recent commits).
https://github.com/jdub/node-twitter
我相信它也支持 REST-API 并且更新更多(最近的提交)。
回答by Joseph Sheedy
There is ntwitter, which was updated within the last couple of months. For me, the hardest part about getting a script up and running to post twitter messages was navigating the auth configuration at dev.twitter.com for the first time. ntwitter handled the rest!
有ntwitter,它在过去几个月内更新。对我来说,启动并运行脚本以发布 twitter 消息最困难的部分是第一次在 dev.twitter.com 上导航身份验证配置。ntwitter 处理剩下的!

