newscoop/instagram-plugin-bundle
Composer 安装命令:
composer require newscoop/instagram-plugin-bundle
包简介
Instagram plugin for Newscoop
关键字:
README 文档
README
This Newscoop Plugin adds smarty functions and Admin tools to enable you to ingest, manage, and display Instagram photos in Newscoop.
Install instructions for Newscoop v4.3 on OSX with MAMP
- php application/console plugin:install newscoop/instagram-plugin-bundle
- Edit the newscoop/application/configs/parameters/custom_parameters.yml file (or create it if it does not exist) and add the following text:
parameters:
instagram_bundle:
client_id: "your client id"
client_secret: "your client secret"
baseurl: "https://api.instagram.com/v1/"
max_count: 500
- Run the following command to ingest the initial 500 photos from Instagram:
php application/console instagram_photos:ingest lennonwall
Update instructions for Newscoop v4.3 on OSX with MAMP
- php application/console plugin:remove newscoop/instagram-plugin-bundle
- follow steps for manual install above
Instagram Photo View
Provides endpoint, /instagram/photos/{id} for viewing single instagram photos cached locally. Loads template Resources/views/Instagram/instagram_photo.tpl or _views/instagram_photo.tpl if it exists in the loaded theme.
Usage:
<img src="{{ $instagramPhoto->getThumbnailUrl() }}" width="{{ $instagramPhoto->getThumbnailWidth() }}" height="{{ $instagramPhoto->getThumbnailHeight() }}"> <img src="{{ $instagramPhoto->getLowResolutionUrl() }}" width="{{ $instagramPhoto->getLowResolutionWidth() }}" height="{{ $instagramPhoto->getLowResolutionHeight() }}"> <img src="{{ $instagramPhoto->getStandardResolutionUrl() }}" width="{{ $instagramPhoto->getStandardResolutionWidth() }}" height="{{ $instagramPhoto->getStandardResolutionHeight() }}"> <p>Id: {{ $instagramPhoto->getId() }}</p> <p>Link: {{ $instagramPhoto->getLink() }}</p> <p>Caption: {{ $instagramPhoto->getCaption() }}</p> <p>Tags: {{ $instagramPhoto->getTags() }}</p> <p>Created by Instagram User: {{ $instagramPhoto->getInstagramUserName() }}</p> <p>Created on: {{ $instagramPhoto->getCreatedAt()|date_format:"Y-m-d" }}</p>
Instagram Photos Search
Note that this only searches the locally stored InstagramPhoto entities, it does NOT make a call to the Instagram Api
Provides endpoint /instagram/photosearch, which takes the following params:
- search - search string, matches against caption, username, tags, and locationName fields
- perPage - number of records per page to send in the results
- offset - the first record to start with (used for pagination)
Results are delivered to _views/instagram_search_results.tpl, if defined in your theme, or a default internal view is used.
Usage:
<div id="nav"> <div class="left-nav"><a href="{{ $prevPageUrl }}">Previous</a></div> <div class="center-nav"><span>found {{ $instagramPhotoCount }} results</span></div> <div class="right-nav"><a href="{{ $nextPageUrl }}">Next</a></div> </div> <br class="clear"> <ul id="photo-results-container"> {{ foreach $instagramPhotos as $photo }} <li> <div id="box" style="background: url({{ $photo->getLowResolutionUrl() }})"> <div id="overlay"> <span id="plus"> Posted By: {{ $photo->getInstagramUserName() }}<br> On: {{ $photo->getCreatedAt()|date_format:"Y-m-d" }}<br> <br> {{ $photo->getCaption() }} </span> </div> </div> </li> {{ /foreach }} </ul>
Instagram List Photos Smarty Block
Provides a smarty block to list instagrams photos with a specfific hashtag.
Usage:
{{ list_instagram_photos tag='lennonwall' length=30 }} <p>{{ $photoIndex }}</p> <p>{{ $photo->getCaption() }}</p> <p>{{ $photo->getCreatedAt() }}</p> <p>{{ $photo->getId() }}</p> <p>{{ $photo->getInstagramUserName() }}</p> <p>{{ $photo->getTags() }}</p> <p>{{ $photo->getLocationName() }}</p> <p>{{ $photo->getLocationLatitude() }}</p> <p>{{ $photo->getLocationLingitude() }}</p> <p>{{ $photo->getLink() }}</p> <p>{{ $photo->getThumbnailUrl() }}</p> <p>{{ $photo->getThumbnailWidth() }}</p> <p>{{ $photo->getThumbnailHeight() }}</p> <p>{{ $photo->getStandardResolutionUrl() }}</p> <p>{{ $photo->getStandardResolutionWidth() }}</p> <p>{{ $photo->getStandardResolutionThumbnailHeight() }}</p> <p>{{ $photo->getLowResolutionUrl() }}</p> <p>{{ $photo->getLowResolutionWidth() }}</p> <p>{{ $photo->getLowResolutionHeight() }}</p> {{ /list_instagram_photos }}
Instagram Photo Ingest Console Command
Usage:
php application/console instagram_photos:ingest lennonwall
where lennonwall is the instagram hashtag that you wish to import from
newscoop/instagram-plugin-bundle 适用场景与选型建议
newscoop/instagram-plugin-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「instagram」 「newscoop」 「photos」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 newscoop/instagram-plugin-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 newscoop/instagram-plugin-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 newscoop/instagram-plugin-bundle 相关的其它包
同方向 / 同关键字的高下载量 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.
Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.
An easy-to-use PHP Class for accessing Instagram's API.
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2014-10-23