php - 渲染 twitter 标准搜索 api
问题描述
我如何呈现 twitter 标准搜索 api
参考:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
我的代码
require_once('TwitterAPIExchange.php');
$settings = array('oauth_access_token' => "XXX",'oauth_access_token_secret' => "XXX",'consumer_key' => "XXX",'consumer_secret' => "XXX");
$url = "https://api.twitter.com/1.1/search/tweets.json";
$requestMethod = "GET";
$getfield = "?q=#XXX from:XXX";
$twitter = new TwitterAPIExchange($settings);
$string = json_decode($twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest(),$assoc = TRUE);
if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>".$string[errors][0]["message"]."</em></p>";exit();}
var_dump($string);
它给了我类似于上面参考的回应
我的问题是如何渲染它?我找不到任何关于此的文档/示例?
像嵌入式时间线和 oEmbedAPI
参考:
https://developer.twitter.com/en/docs/twitter-for-websites/timelines/overview https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/oembed-api
解决方案
推荐阅读
- python - AttributeError:模块“数学”没有属性“_name_”
- javascript - 当我尝试从 themoviedb API 获取图像时出现奇怪的字符
- r - 将 r 环境(列表对象)保存到 SSD 高效
- python - 基于 Spark Dataframe 中不同值的类别列
- html - CSS表格列宽不均匀
- android - 在官方 Android 模拟器上安装 ARM Translation (libhoudini)
- python - 在 Python 列表中查找第二大数字
- amazon-web-services - kinesis 数据流中的分片是什么
- laravel - laravel如何上传视频
- c# - Unity3D:如何修复“TerrainData.SetHeights 错误”