tofers / instagram-post-info
获取Instagram上帖子的数据。昵称,位置,发布日期,点赞数,照片。
1.0.7
2020-10-23 08:19 UTC
Requires
- php: >=5.6.0
README
Instagram帖子信息 - 昵称,图片,日期,点赞,位置
获取Instagram上帖子的数据。昵称,位置,发布日期,点赞数,照片。
只有来自Instagram的公开帖子的链接才能工作,如果是公开账号,结果将出错。
安装
安装此扩展的首选方式是通过Composer。
运行以下命令之一
composer require tofers/instagram-post-info
或
"tofers/instagram-post-info": "*"
将以下内容添加到您的composer.json
文件的require部分。
使用方法
查看它的工作方式
在您的视图中设置扩展链接
<?php use tofers\instagrampost\InstagramPostInfo; $instagram_post = new InstagramPostInfo("https://www.instagram.com/p/CB7KzC6BPIn/"); echo 'instagram link: ' . $instagram_post->src; echo '<br>'; echo '<br>'; echo 'Account name: ' . $instagram_post->account; echo '<br>'; echo '<br>'; echo 'Image src: ' . $instagram_post->image; echo '<br>'; echo '<br>'; echo 'Date post: ' . $instagram_post->date; echo '<br>'; echo '<br>'; echo 'Like post: ' . $instagram_post->like; echo '<br>'; echo '<br>'; echo 'Location: ' . $instagram_post->location; ?>