pixney/statamic-instagram-user-feed
Composer 安装命令:
composer require pixney/statamic-instagram-user-feed
包简介
Instagram Feed And Stories addon for Statamic
README 文档
README
This addon will allow you to fetch instagram feed and storied without Oauth.
Difference from the free version available in the marketplace
- You are able to cache the feed
- An ajax request is made and your feed is returned as json. Which prevents render blockage.
Problem : checkpoint_required
If you have this issue, it means they have detected suspicious behaviour with your instagram account you are using to scrape the data. This is easily solved by logging in to your instagram account and paste the security code it will email you.
Attention: This addon is based on the following stable and popular package: Instagram User Feed
If for some reason it should stop working, so might this addon. Please keep that in mind before buying this addon. However, that package has been around for a while and we have used it since 2018 without having any problems.
Quick Start
You could use your real instagram account, but we recommend getting a dummy one and use that.
ENV Settings
Once you have your username and password, add those credentials to your .env file:
INSTAGRAM_USERNAME=
INSTAGRAM_PASSWORD=
Below are the other optional settings you can make to your .env file. INSTAGRAM_EXPIRATION & INSTAGRAM_TAKE can be set using the Antlers tag. It is handy if you want to show different feeds with different settings.
# The url used to get the feeds remember to start and end it with a slash.
INSTAGRAM_URL="/statamic-instagram-user-feed/"
# Control how the date is formatted
INSTAGRAM_DATE_FORMAT="Y-m-d H:i:s"
# Set the expiration time of the cache.
INSTAGRAM_EXPIRATION=3600
# Set how many posts should be fetched.
INSTAGRAM_TAKE=3
# Activate a check to make sure traffic comes from your own website
INSTAGRAM_CHECK_REFERER=true
If you don't specify these, the default values shown will be used.
Add Alpine to your project
Don't worry, you don't have to use Alpine if you don't like. A simple JSON object is returned to you, which means you can use whatever tool you like such as Vanilla Javascript, Vue, React or whatever.
However, we wanted to get up and run quickly, so we added a default view for you which included an Alpine implementation and the Fetch API. Go to their website to see the best practices when it comes to installation.
For now, let us add the following script tag to your layout file:
(For some reason the script tag is not correctly rendered over at the Marketplace, but the path is : https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.0/dist/alpine.min.js , or go to the addons github page where it renders correctly.)
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.0/dist/alpine.min.js" defer></script>
Finally add our tag wherever you want to display your instagram feed (Important: You must supply the profile of whos feed you want to display):
{{ statamic_instagram_user_feed profile="pixney" }}
You are done and it should work!
Tag Parameters
{{ statamic_instagram_user_feed profile="pixney" expiration="3600" take="3" }}
| Field | Default Value | Description |
|---|---|---|
| profile | null | Instagram profile name to get feed from. |
| expiration | 3600 | Number of seconds to cache the feed. |
| take | 3 | The number of posts to get (default:3,min:1,max:12) |
Available fields
| Field | Description |
|---|---|
| id | Instagram Profile ID |
| fullName | Instagram Profile Full Name |
| biography | Instagran Profile Biography |
| externalUrl | Instamgram Profile Url |
| profilePicture | Instagram Profile Picture |
| feed | Instagram Profile Feed (See available fields below) |
Feed
| Field | Description |
|---|---|
| id | Feed Id |
| width | Width of post image in pixels |
| height | Height of post image in pixels |
| displaySrc | Post Image |
| getThumbnailSrc | Post Thumbnail Image |
| date | Post Date |
| caption | Post Caption |
| captionWithoutHashtags | Post Caption without hashtags |
| comments | Post Comments |
| likes | Post Likes |
| link | Post Link |
| location | Location if set |
| hashtags | Post Hashtags |
Publish and Customize the view to your liking
Run the following command to publish a fully customizable view: php artisan vendor:publish --tag=statamic-instagram-user-feed-views --force
Publish the configuration
You should not need to change anything to the configuration file, but it
is possible by the following command : php artisan vendor:publish --tag=statamic-instagram-user-feed-config --force
Alpine Helpers
If you love Alpine just like us, maybe you wanna continue using it. If that is the case, make sure you checkout the available helpers. Especially these two:
Roadmap
- Include instagram stories
- Add front end themes using Tailwind CSS
- Add more functionality and options
- Write tests
License
Before going into productions with Statamic Instagram User Feed, you need to buy a license at the Statamic Marketplace.
Statamic Instagram User Feed is not free software.
pixney/statamic-instagram-user-feed 适用场景与选型建议
pixney/statamic-instagram-user-feed 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 118 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「instagram」 「social media」 「statamic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pixney/statamic-instagram-user-feed 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pixney/statamic-instagram-user-feed 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pixney/statamic-instagram-user-feed 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Craft CMS plugin to receive Instagram feed data as variable in templates.
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
LinkedIn integration for Social
Laravel Media Popup to upload/view the files
An easy-to-use PHP Class for accessing Instagram's API.
统计信息
- 总下载量: 118
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2021-01-22