intracto/socialstats-bundle
Composer 安装命令:
composer require intracto/socialstats-bundle
包简介
This bundle provides a way to keep track of your social media accounts with Symfony2
README 文档
README
##Installation Load the bundle in app/AppKernel.php
public function registerBundles()
{
$bundles = array(
...
new SocialStatsBundle\SocialStatsBundle()
);
....
Run composer update or install to make sure you have all necessary vendors installed.
Update your doctrine schema
php app/console doctrine:schema:update --force
You are now ready to configure the bundle.
##Bundle configuration The following is required in your config.yml file.
social_stats:
twitter:
api_key: %social_stats.twitter.api_key%
api_secret: %social_stats.twitter.api_secret%
access_token: %social_stats.twitter.access_token%
access_token_secret: %social_stats.twitter.access_token_secret%
owner_id: %social_stats.twitter.api_owner_id%
facebook:
app_id: %social_stats.facebook.app_id%
api_secret: %social_stats.facebook.api_secret%
You need to specify your Facebook pages and Twitter names in the parameters.yml file. Your API authentication info goes here too.
social_stats.twitter.api_key: "EDIT ME"
social_stats.twitter.api_secret: "EDIT ME"
social_stats.twitter.access_token: "EDIT ME"
social_stats.twitter.access_token_secret: "EDIT ME"
social_stats.twitter.api_owner_id: "1234567890"
social_stats.twitter.usernames:
- "Intracto"
- "..."
social_stats.facebook.app_id: "123456789012345"
social_stats.facebook.api_secret: "EDIT ME"
social_stats.facebook.pages:
- "intracto"
- "..."
##Data structure
Every log has following properties.
| Property | Description |
|---|---|
| ID | A unique identifier |
| Timestamp | A datetime field |
| Source | Source of data. E.g. Facebook |
| Account | Account of which we logged data. E.g. Intracto |
| Type | Type of data we logged E.g. likes |
| Content | Actual data. E.g. 15695 |
##Logging social media
Set up a cron job to execute these commands from the Symfony console. You can choose how often you log, but every 12 hours is recommended.
php app/console socialstats:log:facebook:page-likes-count
php app/console socialstats:log:twitter:follower-count
These commands will use the usernames or pagenames set up in your parameters.yml file, so make sure these are correct.
##Generating dummy data When you have set up a few usernames or pagenames, you can create some dummy data to check out the functionality of this bundle. You do this by executing following command.
php app/console socialstats:generator:log-dummy-data
This will generate dummy data logs, for each account specified in parameters.yml. 100 logs will be created for each type (Likes, Follower count) of each social network (Facebook and Twitter).
php app/console socialstats:generator:log-dummy-data --quantity=50 Twitter
You can change the quantity and the social network (a.k.a. source) as you desire.
** Keep in mind that the command will not generate 50 logs in total. **
It will generate 50 logs for each username/page of all the logging types available for the source type.
intracto/socialstats-bundle 适用场景与选型建议
intracto/socialstats-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「statistics」 「socialmedia」 「software」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 intracto/socialstats-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 intracto/socialstats-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 intracto/socialstats-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Helper to handle stats table with multiple formatter
The "View Counter" bundle
SPSS is a php-based implementation of IBM SPSS Statistics Standard. (Read/write SPSS, PSPP .sav files)
TYPO3 View-Statistics by coding.ms: Logs frontend actions in TYPO3 and displays them in a backend module. It tracks page views, news, downloads, and objects such as products or real estate, while custom objects can be configured via TypoScript. Frontend logins, login duration, user ID, IP address, a
Partition problem for balanced arrays splitting made easy.
A abstraction for generating metrics in Laravel.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-13