nikapps / bazaar-push

基于 Laravel 框架的机器人,用于 CafeBazaar 开发者面板,定期将您的应用程序信息通过 PushBullet 推送到您的手机或其他客户端。

安装: 20

依赖关系: 0

建议者: 0

安全: 0

星级: 6

关注者: 5

分支: 1

开放问题: 0

类型:项目

v1.0 2014-11-11 06:34 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:54:30 UTC


README

BazaarPush 是基于流行的 Laravel 框架的包装器,定期登录您的 CafeBazaar 账户,解析页面并将新事件(如销售)的报告推送到您的设备(通过 PushBullet)。

BazaarPush

安装

是否需要波斯语的视频?(Aparat

使用 composer,将此包依赖项添加到 Laravel 的 composer.json 中

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

更新 composer

composer update

在您的 providers 数组中添加此包提供者 [app/config/app.php]

'Nikapps\BazaarPush\BazaarPushServiceProvider'

为此包运行迁移,这将添加一个名为 bazaar_sale 的表到您的数据库中,用于跟踪您的销售记录。运行

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

发布配置文件。运行

php artisan config:publish nikapps/bazaar-push

运行

php artisan

如果您看到 bazaarpush 命名空间命令,您就可以开始使用了!

配置

打开 [app/config/packages/nikapps/bazaar-push/config.php]。设置您的 CafeBazaar 凭据,每个凭据都像以下示例一样作为一个关联数组

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

像以下示例设置您的 PushBullet 账户,从 PushBullet 获取您的 PushBullet API 密钥

"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.
       ],
       .
       .
       .
   ],

添加 Cronjob

此 cronjob 每 20 分钟运行一次检查命令,并从 CafeBazaar 获取新的销售记录。它还将新的事件作为推送报告到您的设备。别忘了更改 artisan 路径:)

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

可能的问题

  • 此项目解析 CafeBazaar 页面并从它们中获取所需的数据,如果 CafeBazaar 改变了当前的仪表板布局,我们需要更改匹配的正则表达式模式。我们的建议是为此项目设置一个监视器以跟上更新。
  • 目前 CafeBazaar 只提供最新的 100 条销售记录,所以如果您在 20 分钟内有超过 100 条销售记录(#伊朗的富二代!),您会丢失一些记录。

未来

推送每日收入以及新的评论。想贡献吗?只需分支此项目并提交 pull request!

依赖关系

许可证

本项目采用 MIT 许可证 发布。

/*
 * 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.
 */

捐赠

Donate via Paypal