Giter Club home page Giter Club logo

pokemon-go's Introduction

pokemon-go - Pokémon Go API PHP Library

Latest Version on Packagist Software License Minimum PHP Version Latest Stable Version Total Downloads PHP7 Ready

This library aims to provide the tools to communicate with the Pokemon Go API. It is still work in progress.

This package is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Install

Via Composer

$ composer require drdelay/pokemon-go

Usage

$auth = (new \DrDelay\PokemonGo\Auth\PtcAuth())
    ->setCredentials('PTCUser', 'PTCPass');
// Check the folder ./src/Auth for more Auth implementations

$client = (new \DrDelay\PokemonGo\Client())
    ->setCache(...) // Any PSR-6 compliant cache (Optional for Ptc/GoogleAuth, **necessary** for GoogleOAuth, recommended always)
    ->setAuth($auth) // Anything implementing \DrDelay\PokemonGo\Auth\AuthInterface
    ->setLogger(...); // Optional, any PSR-3 compliant logger

$client->setLocation(...); // A \DrDelay\PokemonGo\Geography\Coordinate , optional
$playerData = $client->login(); // Returns an instance of \POGOProtos\Data\PlayerData

$response = $client->sendRequest(...); // Define own requests by implementing \DrDelay\PokemonGo\Request\ApiRequestInterface / extending \DrDelay\PokemonGo\Request\AbstractApiRequest
// See \DrDelay\PokemonGo\Request\ApiRequests\GetPlayerRequest/ExampleMultiRequest as examples

Known issues of this alpha

Google login

There are currently 2 implementations of the Google login (see #1):

  • GoogleAuth: You have to provide your Google account credentials
  • GoogleOAuth: You do not have to provide your Google account credentials, but do the Google OAuth process by entering a code on google.com/device (being logged in there)

Google OAuth login

If you login with GoogleOAuth you should catch \DrDelay\PokemonGo\Auth\DeviceNotVerifiedException at the login call. It gets raised if a verification on the google website is needed.

See the message, and the getVerificationUrl / getUserCode methods

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

See also

License

The MIT License (MIT). Please see License File for more information.

Legal

This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Niantic, The Pokémon Company, Nintendo or any of its affiliates or subsidiaries. This is an independent and unofficial API library. The contents of this repository are a proof of concept and are for educational use only. Using this project might be against Niantic's TOS.

pokemon-go's People

Contributors

drdelay avatar barryvdh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.