我尝试在 php 上使用 twitter api,这是非常基本的公共推文拉取。现在我正在java和android上学习它,我的代码应该拉动或处理上面有图像或视频的推文。我阅读了 twitter api 的文档并搜索了相当长的时间,但到目前为止我找不到好的文档、教程或示例。
你有什么想法吗?或者您可以分享的示例代码?
谢谢。
Get all tweets of your request, decode the redirector links (such as bit.ly) to get the actual links and then check for the domain (such as youtube.com or instagram.com). If you just want to show the tweet, you're fine but actually getting the image that the link points to is harder because you need to implement it for every single imagehoster you want to support.
To access to Twitter you can use Twitter4j. As far as I know it is not possible to get native media previews with Twitter4j (but you can use the links as described above).