将用户的推文和提及嵌入网站的最佳方式是什么?
我需要将特定用户最近的推文嵌入到网站的主页上。该网站是用 ASP.NET 构建的。
我查看了 Twitter REST API 并尝试使用 user_timeline
。它有效,但不包含用户的提及。我想添加提及,但唯一的方法似乎是使用需要身份验证的 API。我不想使用身份验证,因为它似乎会让事情变得更加复杂。我也不想让当前用户进行身份验证。
实现这一目标的最佳方法是什么?
I need to embed a specific user's recent tweets onto the home page of a website. The website is built in ASP.NET.
I've looked at the Twitter REST API and have tried using the user_timeline
. It works but does not include mentions for the user. I want to include mentions but the only way to do it seems to be by using APIs that require authentication. I would prefer not to use authentication as it seems it would start to make things more complicated. I also do not want to get the current user to authenticate.
What is the best way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请改用
GET 搜索
API。搜索包含用户的@用户名的状态,但在这种情况下,它不会返回私人/锁定帐户的提及,因为没有身份验证。例如,如果您想搜索 @stackexchange 的提及,请调用此。
Use the
GET search
API instead. Search for statuses containing the user's @username, but in this case it will not return mentions from private/locked accounts since there's no authentication.For example, if you want to search mentions for @stackexchange, call this.
您可以使用 REST 搜索 API 搜索 @username。有一个很好的机会可以工作:)
You could do a search for @username using the REST Search api. There's a good chance that would work :)