我如何使用 php 显示来自 twitter 的 twitter 推文
我想使用 php 在我的网页中显示来自 twitter 的 twitter 推文。任何人有想法帮助我
提前致谢。
i want to display twitter tweets in my webpage from twitter using php. anyone have idea help me
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您好,请查看 twitter API: http://dev.twitter.com/pages/libraries #php
Hello please take a look at the twitter API: http://dev.twitter.com/pages/libraries#php
除了 Twitter 开发人员页面上列出的库之外,您还可以使用
Zend_Service_Twitter
使用 Twitter API:In addition to the libraries listed at the Twitter Developer Pages, you can use
Zend_Service_Twitter
to work with the Twitter API:如果您想要一个真正简单的解决方案,您甚至可以使用 twitter 小部件: http://twitter.com/goodies/widgets
If you want a real easy solution, you could even grab the twitter widget: http://twitter.com/goodies/widgets
您可以向 Dabr 学习,它是一个用 PHP 编写的 PHP 前端。它几乎包含了 Twitter API 的所有功能。
You could learn from Dabr, which is a PHP-frontend written in PHP. It has almost all the features of the Twitter API included.
这是我发现的基本功能最好的一个。它基于 javascript,因此显然您不会遇到 API 每小时调用限制的问题。它为您提供了可以轻松修改的标记。
http://twitter.com/widgets/html_widget
哦,不用担心所有批评你问题的人。我没有在该网站的任何指南中读到您的问题必须非常先进才能给每个人留下深刻的印象。 ;-)
This is the best one I've found for basic functionality. It's javascript based, so apparently you're not going to run into issues with the API calls-per-hour limits. And it gives you markup that you can easily modify however you like.
http://twitter.com/widgets/html_widget
Oh, and don't worry about all the people criticizing your question. I didn't read in the guidelines anywhere for this site that you're question has to be significantly advanced to impress everyone. ;-)
好吧,我遇到了这篇文章,并努力寻找答案...但这是我的解决方案...工作完美...我看到的唯一问题是基于检索 RSS 提要,Twitter 非常渴望获得该提要摆脱 - 但对于一个简单的解决方案来说,它很有魅力。
这就是我的解决方案,但是它非常具体于我想要的 - 但你们中的大多数人都可以希望解决这个问题并进行必要的调整。我不是一个特别出色的编码员,所以如果我犯了明显的错误或者可以改进这个脚本,我将不胜感激。
Ok so I ran into this post and struggled with the answers... but here is my solution... works perfectly... the only issue I see is that is based around retrieving the RSS feed, which Twitter is pretty keen to get rid of - but for a simple solution it works a charm.
So this is my solution, however it's quite specific to what I wanted - but most of you can work this out hopefully and make necessary adjustments. I'm not a particularly great coder, so if I've made blatant mistakes or could improve this script I would appreciate it.
Twitter API 正在发生变化,显示要求不再是可选的。因此,除了现在要求使用 Oauth 之外,您还应该满足这些显示标准因为它们不再是可选的。
有一些 PHP 库可以帮助访问 Twitter API 1.1 版本,我选择使用 CodeBird 而不是继续推进我自己的前进。我认为文档可能会更好一些。
The Twitter API is changing and display requirements are no longer optional. So in addition to requiring the use of Oauth now, you should also be meeting these display standards as they are no longer optional.
There are PHP libraries that help access version 1.1 of the Twitter API, I chose to use CodeBird rather than continue to roll my own going forward. I think the documentation could be a little better though.