nikapps/bazaar-push 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nikapps/bazaar-push

Composer 安装命令:

composer create-project nikapps/bazaar-push

包简介

a robot based on Laravel framework for CafeBazaar developer panel which regularly pushes information about your apps on your mobile phone or other clients via PushBullet.

README 文档

README

BazaarPush is a wrapper based on the popular Laravel Framework which regularly logs into your CafeBazaar accounts, parses pages and pushes reports of new events such as sales on to your devices (via PushBullet).

BazaarPush

Installation

Would you rather a video (in Persian) ? Aparat

Using composer, add this package dependency to your Laravel's composer.json :

{
    "require": {
        "nikapps/bazaar-push": "1.*"
    }
}

Update composer :

composer update

Add this package provider in your providers array [app/config/app.php] :

'Nikapps\BazaarPush\BazaarPushServiceProvider'

Run migrations for this package, this will add a table to your database named bazaar_sale which keeps track of your sale records. Run :

php artisan migrate --package="nikapps/bazaar-push"

Publish configuration file. Run :

php artisan config:publish nikapps/bazaar-push

Run :

php artisan

if you see a bazaarpush command namespace, you are all set to go !

Configuration

Open [app/config/packages/nikapps/bazaar-push/config.php]. Setup your CafeBazaar credentials, each one of them as an associative array like the example below :

"credentials" => [
       [
           "email" => "first@account.com",
           "password" => "secret"
       ],
       [
           "email" => "second@account.com",
           "password" => "top secret"
       ], 
       .
       .
       .
   ]

Setup your PushBullet accounts like the example, get your PushBullet API key from PushBullet

"pushbulletKeys" => [
       [
           "key" => "FirstAccountKey",
           "accounts" => ['first@account.com'] // declare CafeBazaar accounts as an array which you want to get reports from them
           "devices" => ['LGENexus 4'] // declare your devices as an array which you want to get pushes on them
       ],
       [
           "key" => "SecondAccountKey",
           "accounts" => null, // you can pass null to get reports from all of your declared CafeBazaar accounts in credentials section
           "devices" => null // you can pass null to get pushes on all of the devices associated with this PushBullet account.
       ],
       .
       .
       .
   ],

Adding Cronjob

This cronjob runs the checking command each 20 minutes and fetches the new sales from CafeBazaar. Also, it will report new events as a push to your devices. Don't forget to change the artisan path :)

*/20 * * * * php /absolute/path/to/your/artisan bazaarpush:sale >/dev/null 2>&1

Probable issues

  • This project parses CafeBazaar pages and fetches required data from them, if CafeBazaar changes the current panel layout we need to change the matching Regular Expression patterns. Our recomendation is to set a watcher on this project to keep up with the updates.
  • At this moment CafeBazaar just gives the latest 100 sale records, so if you have more than 100 sale records in 20 minutes (#RichKidsOfIran !), you'll lose some of the records.

Future

Pushing the daily income and also new comments. Wanna contribute ? simply fork this project and make a pull request !

Dependencies

License

This project released under the MIT License.

/*
 * Copyright (C) 2014 NikApps Team.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * 1- The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * 2- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

Donation

Donate via Paypal

nikapps/bazaar-push 适用场景与选型建议

nikapps/bazaar-push 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 6, 最近一次更新时间为 2014 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「notification」 「laravel」 「push」 「android」 「chrome」 「ios」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 nikapps/bazaar-push 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nikapps/bazaar-push 我们能提供哪些服务?
定制开发 / 二次开发

基于 nikapps/bazaar-push 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-11