将 Twitter 图片作为网站的拼贴画嵌入
Embed Twitter pics as a collage for a website
我正在尝试创建来自 Twitter 提要的图像拼贴画,以显示在网站横幅中。
So far I have set up the Twitter authentication
我不确定如何只从她的 Feed 中提取图像,或者以所需的方式嵌入它们。
如有任何帮助或信息,我们将不胜感激。
Click here to view a possible outcome I'm looking for.
谢谢!
要简单地转储几张图片,试试这个:
<?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
}
我正在尝试创建来自 Twitter 提要的图像拼贴画,以显示在网站横幅中。
So far I have set up the Twitter authentication
我不确定如何只从她的 Feed 中提取图像,或者以所需的方式嵌入它们。
如有任何帮助或信息,我们将不胜感激。
Click here to view a possible outcome I'm looking for.
谢谢!
要简单地转储几张图片,试试这个:
<?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
}