我正在尝试创建一个源自Twitter Feed的图像拼贴,以便在网站横幅中显示。
So far I have set up the Twitter authentication
我不确定如何从她的饲料中提取图像,或以所需的方式嵌入它们。
非常感谢任何帮助或信息。
Click here to view a possible outcome I'm looking for.
谢谢!
答案 0 :(得分:0)
要简单地转储几张图片,请尝试以下操作:
<?php
require_once("/twitteroauth/twitteroauth.php");
$consumerKey = "0LQwV6gQi1hi8TPOMvfqy7qpM";
$consumerSecret = "AuShkWcg7lj8VYyKYOH6WPW8tY6B2QuB8kgRpmALVrg0VK0mM0";
$accessToken = "624631261-DjWeq4RB0eGAB2lr68skZE1zbfDcg2x6BEyJzFZO";
$accessTokenSecret = "8XnWnkiFQ803r9sHVkDrZNhD50EuJlnw8sZI2EPsA9p7X";
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
$tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=%rhyareegaming%20filter%3Aimages&include_entities=true");
foreach ($tweets->statuses as $status) {
?>
<img src="<?php echo $status->entities->media[0]->media_url; ?>">
<?php
}