c2is/socialwall-bundle
Composer 安装命令:
composer require c2is/socialwall-bundle
包简介
Bundle integrating the C2iS SocialWall component into Symfony2
README 文档
README
Installation
Install with composer:
composer require c2is/socialwall-bundle dev-master
Add the bundle to your AppKernel:
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new C2is\Bundle\SocialWallBundle\C2isSocialWallBundle(), ); return $bundles; } }
Configuration reference
c2is_social_wall: social_networks: facebook: # Used to fetch posts and number of followers of a specific user user_id: ~ # Required limit: 50 api: api_key: ~ # Required api_secret: ~ twitter: # Used to fetch posts with the given tags tags: [] # Used to fetch tweets from a specific user user: ~ # Used to fetch number of tweets and number of followers of a specific user user_id: ~ limit: 50 api: api_key: ~ # Required api_secret: ~ flickr: # Used to fetch posts with the given tags tags: [] # Used to fetch posts number of followers of a specific user user_id: ~ limit: 50 api: api_key: ~ # Required api_secret: ~ instagram: # Used to fetch posts with the given tag tag: ~ # Used to fetch posts number of followers of a specific user user_id: ~ limit: 50 api: api_key: ~ # Required api_secret: ~ google_plus: # Used to fetch posts number of followers of a specific user user_id: ~ # Required limit: 50 api: api_key: ~ # Required api_secret: ~ youtube: # Used to fetch posts number of followers of a specific user channel_id: ~ # Used to fetch posts number of followers of a specific playlist playlist_id: ~ limit: 50 api: api_key: ~ # Required api_secret: ~ cache: duration: '3600'
Usage
This bundle exposes a service providing helper methods to access the SocialWall component:
class MyController { public function myAction() { $socialWall = $this->get('c2is.social_wall.manager'); /* Those methods will throw an exception if the social network is not properly configured */ $twitterItems = $socialWall->getTwitterItemsForUser($overrideUser /* if omitted, uses the user_id defined in the configuration */,, $overrideLimit /* if omitted, uses the limit defined in the configuration */,); $twitterItems = $socialWall->getTwitterItemsForTags($overrideTags /* if omitted, uses the tags defined in the configuration */, $overrideLimit /* if omitted, uses the limit defined in the configuration */); } }
Available methods:
- getFacebookItems($userId = null, $limit = null) If userId or limit are omitted, uses the values defined in the configuration. Returns $limit posts from the user $userId timeline.
- getFacebookNumberOfSubscribers($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of people who liked the facebook page of the user $userId.
Available methods:
- getTwitterItemsForUser($userId = null, $limit = null) If userId or limit are omitted, uses the values defined in the configuration. Returns $limit tweets from the user $userId.
- getTwitterItemsForTags(array $tags = null, $limit = null) If tags or limit are omitted, uses the values defined in the configuration. Returns $limit tweets having at least one of the tags tag.
- getTwitterNumberOfItems($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of tweets made by the user $userId.
- getTwitterNumberOfSubscribers($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of people following user $userId.
Flickr
Available methods:
- getFlickrItemsForUser($userId = null, $limit = null) If userId or limit are omitted, uses the values defined in the configuration. Returns $limit flickr images posted by the user $userId.
- getFlickrItemsForTags(array $tags = null, $limit = null) If tags or limit are omitted, uses the values defined in the configuration. Returns $limit flickr images having at least one of the tags tag.
- getFlickrNumberOfItems($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of flickr images posted by the user $userId.
Available methods:
- getInstagramItemsForUser($userId = null, $limit = null) If userId or limit are omitted, uses the values defined in the configuration. Returns $limit instagram posts from the user $userId.
- getInstagramItemsForTags(array $tags = null, $limit = null) If tags or limit are omitted, uses the values defined in the configuration. Returns $limit instagram posts having at least one of the tags tag.
- getInstagramNumberOfItems($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of instagram iamges posted by the user $userId.
- getInstagramNumberOfSubscribers($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of people following user $userId.
Google Plus
Available methods:
- getGooglePlusItems($userId = null, $limit = null) If userId or limit are omitted, uses the values defined in the configuration. Returns $limit Google Plus posts from the user $userId timeline.
- getGooglePlusNumberOfSubscribers($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of people who have the user $userId in their circles.
Youtube
Available methods:
- getYoutubeItemsForChannel($channelId = null, $limit = null) If channelId or limit are omitted, uses the values defined in the configuration. Returns $limit videos from the $channelId channel.
- getYoutubeItemsForPlaylist($playlistId = null, $limit = null) If playlistId or limit are omitted, uses the values defined in the configuration. Returns $limit videos from the $playlistId playlist.
- getYoutubeNumberOfSubscribers($userId = null) If userId is omitted, uses the value defined in the configuration. Returns the number of video views for user $userId.
c2is/socialwall-bundle 适用场景与选型建议
c2is/socialwall-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.96k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「twitter」 「google」 「facebook」 「youtube」 「social」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 c2is/socialwall-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 c2is/socialwall-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 c2is/socialwall-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Simple Twitter API wrapper
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
A PSR-7 compatible library for making CRUD API endpoints
A helper module for pdf-print, print and social share functionality based on bootstrap to custom modules.
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.
统计信息
- 总下载量: 14.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-07-08