nicklasw / pkm-go-api
Pokemon Go API库。
v2.0.5
2016-12-31 13:14 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.2.1
- illuminate/support: ^5.2
- jeremeamia/xstatic: ^1.0
- nicklasw/pogoprotos-php: ^v2.0
- nicklasw/s2-geometry-library-php: ^v2.0
- paquettg/php-html-parser: 1.7
- php-di/php-di: ^5.3
- phpseclib/phpseclib: ^2.0
- psr/log: ^1.0
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
This package is not auto-updated.
Last update: 2024-09-26 02:26:06 UTC
README
Pokemon GO PHP API库
安装
运行命令 composer require nicklasw/pkm-go-api
。
使用方法
示例
// Create the authentication config $config = new Config(); $config->setProvider(Factory::PROVIDER_PTC); $config->setUser('INSERT_USER'); $config->setPassword('INSERT_PASSWORD'); // Create the authentication manager $manager = Factory::create($config); // Add a event listener, $manager->addListener(function ($event, $value) { if ($event === Manager::EVENT_ACCESS_TOKEN) { /** @var AccessToken $accessToken */ $accessToken = $value; // Persist the access token in session storage, cache or whatever. } }); // Initialize the pokemon go application $application = new ApplicationKernel($manager); // Retrieve the pokemon go api instance $pokemonGoApi = $application->getPokemonGoApi(); // Retrieve the inventory $inventory = $pokemonGoApi->getInventory(); // Retrieve the poke bank $pokeBank = $inventory->getPokeBank(); // Retrieve a pokemon of type pidgey $pokemon = $pokeBank->getPokemonsByType(PokemonId::PIDGEY)->first(); // Transfer / Release the pokemon (Send to the meat grinder) $pokemon->transfer();
待办事项
- 实现地图API
- 改进日志记录
贡献者
测试
$ composer test
Slack聊天室
我们使用Slack进行社区讨论。您可以在以下链接找到我们的团队:https://pokemongoapi-php.slack.com
致谢
- Grover-c13提供灵感
- AeonLucid改进原型