-
Notifications
You must be signed in to change notification settings - Fork 35
/
example.php
36 lines (28 loc) · 1.03 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require_once 'Skiplagged.php';
$client = new Skiplagged();
// Determine a bounding box to traverse and look for pokemon
//$bounds = [
// [40.76356269219236, -73.98657795715332], # Lower left lat, lng
// [40.7854671345488, -73.95812508392333] # Upper right lat, lng
//]; # Central park, New York City
$bounds = $client->getBoundsForAddress('central park, ny');
echo json_encode($bounds)."\n";
while (1) {
try {
// Log in with a Google or Pokemon Trainer Club account
//echo json_encode($client->loginWithGoogle('EMAIL', 'PASSWORD'))."\n";
echo json_encode($client->loginWithPokemonTrainer('USERNAME', 'PASSWORD'))."\n";
// Get specific Pokemon Go API endpoint
echo $client->getSpecificApiEndpoint()."\n";
// Get profile
echo json_encode($client->getProfile())."\n";
// Find pokemon
$client->findPokemon($bounds, function($pokemon) {
echo $pokemon."\n";
});
} catch (Exception $e) {
\Utils\General::log($e);
sleep(1);
}
}