Package Data | |
---|---|
Maintainer Username: | nikapps |
Maintainer Contact: | h.moradgholi@icloud.com (Hossein Moradgholi) |
Package Create Date: | 2014-11-07 |
Package Last Update: | 2014-11-11 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-09 15:04:45 |
Package Statistics | |
---|---|
Total Downloads: | 20 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 6 |
Total Watchers: | 5 |
Total Forks: | 1 |
Total Open Issues: | 0 |
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).
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 !
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.
],
.
.
.
],
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
Pushing the daily income and also new comments. Wanna contribute ? simply fork this project and make a pull request !
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.
*/