Download the PHP package cornford/pokenotifier without Composer

On this page you can find all versions of the php package cornford/pokenotifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pokenotifier

An easy way to send nearby Pokemon notifications to Slack

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality

Think of Pokenotifier as an easy way to generate Slack notifications for nearby Pokemon using PokemonGo-Map. These include:

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require cornford/pokenotifier.

"require": {
    "cornford/pokenotifier": "1.*"
}

Next, update Composer from the Terminal:

composer update

Finally we need to introduce the configuration files into your application/

cp src/config/{example.,}application.php

That's it! You're all set to go.

Configuration

You can now configure Pokenotifier in a few simple steps. Open src/config/application.php and update the options as needed.

Usage

It's really as simple as using the Pokenotifier class in any Controller / Model / File you see fit with:

$notifier = new Cornford\Pokenotifier\Notifier();

This will give you access to

Process Scan Request

The processScanRequest method allows you to process a scan request, using a position object as a parameter.

$notifier->processScanRequest(new Cornford\Pokenotifier\Models\Position(0, 0));

Process Scan Request

The processWebhookRequest method allows you to process a webhook request, using a position object, and request data as parameters.

$notifier->processWebhookRequest(new Cornford\Pokenotifier\Models\Position(0, 0), ['pokemons'=> []]);

Request Pokemon Go Map Scan

The requestPokemonGoMapScan method allows you to send a scan request to PokemonGo-Map, using a position object as a parameter.

$notifier->requestPokemonGoMapScan(new Cornford\Pokenotifier\Models\Position(0, 0));

Request Pokemon Go Map Data

The requestPokemonGoMapData method allows you to send a data request to PokemonGo-Map.

$notifier->requestPokemonGoMapData();

Expire Cached Items

The expireCachedItems method allows you to expire cached items that haven't been modified for a specified timeout, using a string as a parameter.

$notifier->expireCachedItems('-1 day');

Send Slack Notification

The sendSlackNotification method allows you to send a Slack notification, using an array of Pokemon data, and a position object as parameters.

$notifier->sendSlackNotification(['pokemon_id' => '', 'pokemon_name' => '', 'latitude' => '', 'longitude' => '', 'disappear_time' => ''], new Cornford\Pokenotifier\Models\Position(0, 0));

Process Pokemon

The processPokemon method allows you to process an array of Pokemon's and optionally send a Slack notificaiton, using an array of Pokemon data, a position object, and a boolean for notification as parameters.

$notifier->processPokemon(['pokemons'=> []], new Cornford\Pokenotifier\Models\Position(0, 0), true);

Load Application Configuration

The loadApplicationConfiguration method allows you to load the current application configuration file.

$notifier->loadApplicationConfiguration();

Get Application Configuration

The getApplicationConfiguration method allows you to get the currently stored application configuration.

$notifier->getApplicationConfiguration();

Load Pokemon Configuration

The loadPokemonConfiguration method allows you to load the current Pokemon configuration file.

$notifier->loadPokemonConfiguration();

Get Pokemon Configuration

The getPokemonConfiguration method allows you to get the currently stored Pokemon configuration.

$notifier->getPokemonConfiguration();

Create Guzzle Client

The createGuzzleClient method allows you to instantiate a new Guzzle Client.

$notifier->createGuzzleClient();

Get Guzzle Client

The getGuzzleClient method allows you to get the currently instantiated Guzzle Client.

$notifier->getGuzzleClient();

Set Guzzle Client

The setGuzzleClient method allows you to store a new instantiation of Guzzle Client, using a client object as a parameter.

$notifier->setGuzzleClient(new GuzzleClient(['base_url' => 'http://www.google.com']));

Create Slack Client

The createSlackClient method allows you to instantiate a new Slack Client.

$notifier->createSlackClient();

Get Slack Client

The getSlackClient method allows you to get the currently instantiated Slack Client.

$notifier->getSlackClient();

Set Slack Client

The setSlackClient method allows you to store a new instantiation of Slack Client, using a client object as a parameter.

$notifier->setSlackClient(new SlackClient('https://hooks.slack.com/services/', [], $notifier->getGuzzleClient()));

Create Directory Iterator

The createDirectoryIterator method allows you to instantiate a new Directory Iterator.

$notifier->createDirectoryIterator();

Get Directory Iterator

The getDirectoryIterator method allows you to get the currently instantiated Directory Iterator.

$notifier->getDirectoryIterator();

Set Directory Iterator

The setDirectoryIterator method allows you to store a new instantiation of Directory Iterator, using a iterator object as a parameter.

$notifier->setDirectoryIterator('./cache');

Example

For an example usage see index.php

Webhook

You can run a webhook with PokemonGo-Map with the following command, where the -wh parameter is the location where the script is located. You can run a local webserver, listening locally to respond to webhook request.

sudo python /var/www/PokemonGo-Map/runserver.py -wh http://localhost?type=webhook

Scan

You can run a scan with PokemonGo-Map with the following command, where the post data contains both lat and lon parameters. You can run an application like Traccar Client, to send requests to your webserver for scan.

curl --data "lat=53.3811&lon=-1.4701" http://localhost?type=scan

License

Pokenotifier is open-sourced software licensed under the MIT license


All versions of pokenotifier with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
maknz/slack Version 1.*
jimmiw/php-time-ago Version 0.*
guzzlehttp/guzzle Version 4.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cornford/pokenotifier contains the following files

Loading the files please wait ....