Giter VIP home page Giter VIP logo

pokemon-go-node-api's Introduction

Poke.io

Pokemon GO api node.js library, still WIP, we have a dev channel on discord: https://discord.gg/W9CZTgn (is for dev only don't ask for support here)
Check 'example.js' for examples

Installation & Usage:

npm install pokemon-go-node-api
var Pokeio = require('pokemon-go-node-api')

Check example.js for the result showed in the demo or check the documentation below.

Demo:

alt tag

Documentation:

Pokeio.init(username, password, location, provider, callback)

Initializes Pokeio with either pokemon trainer club credentials or google account. Accepts locations by name or coordinates

Parameters

  • username {String} Your pokemon trainer club or google username
  • password {String} Your pokemon trainer club or google password
  • location {Object} location accepts a combination of type = 'name' & name or type = 'coords' & latitude, longitude, altitude
    • type {String} Must be one of ['name', 'coords']
    • name {String} Address for lookup using the google maps api.
    • coords {Object}
      • latitude {Number}
      • longitude {Number}
      • altitude {Number}
  • provider {String} Must be one of ['ptc', 'google']
  • callback {Function(error)}
    • error {Error}

Pokeio.GetAccessToken(username, password, callback)

Will save the access token to the Pokeio internal state.

Parameters

  • username {String} Your pokemon trainer club username
  • password {String} Your pokemon trainer club password
  • callback {Function(error, token)}
    • error {Error}
    • token {String}

Pokeio.GetApiEndpoint(callback)

Will save the api endpoint to the Pokeio internal state.

Parameters

  • callback {Function(error, api_endpoint)}
    • error {Error}
    • api_endpoint {String}

Pokeio.GetProfile(callback)

Parameters

  • callback {Function(error, profile)}
    • error {Error}
    • profile {Object}
      • creation_time {Number}
      • username {String}
      • team {Number}
      • tutorial {Number/Boolean}
        • poke_storage {String}
        • item_storage {String}
        • daily_bonus {Object}
          • NextCollectTimestampMs {Number}
          • NextDefenderBonusCollectTimestampMs {Number}
        • currency {Object}
          • type {String}
          • amount {Number}

Pokeio.GetLocation(callback)

Reads current latitude and longitude and returns a human readable address using the google maps api.

Parameters

  • callback {Function(error, formatted_address)}
    • error {Error}
    • formatted_address {String}

Pokeio.GetLocationCoords()

Returns

  • coordinates {Object}
    • latitude {Number}
    • longitude {Number}
    • altitude {Number}

Pokeio.SetLocation(location, callback)

Will save cooridinates to the Pokeio internal state. Accepts raw coordinates or location name based on the type property.

Parameters

  • location {Object}
    • type {String} One of ['name', 'coords']
    • name {String} Address for lookup using the google maps api.
    • coords {object}
      • latitude {Number}
      • longitude {Number}
      • altitude {Number}
  • callback {Function(error, coordinates)}
    • error {Error}
    • coordinates {Object}
      • latitude {Number}
      • longitude {Number}
      • altitude {Number}

Pokeio.RenamePokemon(id, name, callback)

Sets the nickname of a pokemon

Parameters

  • id {Object] The pokemon id to change
  • name {String} The new nickname
  • callback {Function(error, status)}
    • error {Error}
    • status {Number}

The status can eather of:

  • UNSET = 0
  • SUCCESS = 1
  • ERROR_INVALID_NICKNAME = 2
  • ERROR_POKEMON_NOT_FOUND = 3
  • ERROR_POKEMON_IS_EGG = 4

Thanks to:

Python demo: tejado

Contact me

@Arm4x Feel free to contact me for help or anything else

pokemon-go-node-api's People

Contributors

armax avatar bart-0110 avatar billyriantono avatar chaoran avatar cypherix93 avatar d-pollard avatar dwynr avatar fidian avatar filharvey avatar gcodes avatar havrylenkok avatar hunterjm avatar hxn-dev avatar jdpnielsen avatar jimmywarting avatar josebaseba avatar kk1423 avatar laskuma avatar moduleon avatar redsparr0w avatar reecube avatar sameerkanda avatar segura2010 avatar spencersharkey avatar tsuz avatar tuxer2299 avatar vexii avatar wain-pc avatar xbytez avatar xcausxn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pokemon-go-node-api's Issues

Error in poke.io.js?

Forgive me if this is a noob question, I have not used node.js much and mostly write in Objective-C and Swift.

I have created ichooseyou.js that simply contains:

var Pokeio = require('pokemon-go-node-api');

When I run it, I get the following error:

/Users/XXX/node_modules/pokemon-go-node-api/poke.io.js:21
const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/XXX/Desktop/pokemonhugo/ichooseyou.js:3:14)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Any ideas?

How to serialize / deserialize?

Looking at the code presently it seems to be very stateful and I don't think it's possible to serialize and deserialize the objects, so I'll find a way to work around it.

However, the application I'm trying to build allows multiple web and mobile users. Obviously I don't want to store all of that state in memory, so I need to be able to serialize and deserialize the object frequently - including the cookies.

Currently I'm bouncing back and forth between this and the python version trying to figure out how the api works and how to best accomplish my goals, but both are hard-coded for a single user. :-/

If it doesn't fit into your long-term goals to make this support an unlimited number of users simultaneously, I can't complain, but if it is I'll give some more specific feedback (most notably the cookie jar needs to be accepted and exportable) and pull requests if I can.

SyntaxError: Unexpected token {

Not sure if it's a merge or typo here

/Pokemon-GO-node-api/poke.io.js:21
const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Pokemon-GO-node-api/example.js:3:14)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Get Player XP?

Is there any way that we can get the player's XP (their total, not their level) through this API?

Unable to get profile

TypeError: Cannot read property 'Requests' of undefined
at Pokeio.self.GetApiEndpoint (/Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/pokemon-go-node-api/poke.io.js:192:38)
at /Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/pokemon-go-node-api/poke.io.js:156:22
at /Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/pokemon-go-node-api/poke.io.js:186:17
at /Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/pokemon-go-node-api/logins.js:101:21
at /Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/gpsoauthnode/oauth.js:115:9
at IncomingMessage. (/Users/senthilsivanath/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/node_modules/gpsoauthnode/oauth.js:75:49)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at doNTCallback2 (node.js:452:9)

Error

Fresh installed, tried to run example.js but got this error:

const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/var/www/html/workspace/pgo/node_modules/pokemon-go-node-api/example.js:3:14)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Safeguarding each callback with try catch

When I look at the module's code. There are a lot of multi-level async call using callbacks without any safeguard. If one of those callbacks are throwing exception, the whole thing is collapsed (halted, force closed, crashed). I've try to put a try catch enveloping the init call without any success since it's not the init call who throw the exception, it's subsequent callbacks did (which obviously didn't covered by try-catch block).

catchPokemon syntax

if(hb.cells[i].WildPokemon[0]){
   var pokemon = PokemonGO.pokemonlist[parseInt(hb.cells[i].WildPokemon[0].pokemon.PokemonId)-1];
   console.log('[+] There is a wild '+pokemon.name);
}

It is a search of wild Pokemon.
Can you explain to me the syntax self.catchPokemon?

TypeError: Cannot read property 'split' of undefined

Hello,

I can't seem to get passed this part of the script, any ideas? (script is untouched, just trying to run main.js):

var ticket = r.headers['location'].split("ticket=")[1]
^

TypeError: Cannot read property 'split' of undefined
at Request._callback (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\logins.js:32:51)
at Request.self.callback (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:187:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:1044:10)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:965:12)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)

Login with Google account

Hi!
Can I login using a google token?

I don't know my password because I've signed in with google account, and the same password as the google acount does not work, have you tried it?

Thanks!

Compatibility with PokemonGo-Map JSON

I'm trying to get this to work with the python client's web UI. The sample data looks like this:

I'm just poking around right now and trying to figure out where these values came from (and how they were converted from the binary formats and s2 formats, etc). If there's anything you can immediately comment on please do so. Otherwise I'll just be working my way through. :)

{
    "pokemons": [
        {
            "disappear_time": 1469159020156,
            "encounter_id": "MTUzMjQxMjY4NTg4NDUyMTExMTc=",
            "latitude": 40.36915523640919,
            "longitude": -111.75098587678943,
            "pokemon_id": 16,
            "pokemon_name": "Pidgey",
            "spawnpoint_id": "874d84035d7"
        }
    ],
    "gyms": [
        {
            "enabled": true,
            "guard_pokemon_id": 59,
            "gym_id": "ffb14e36c7344c289457faa20319681c.16",
            "gym_points": 10495,
            "last_modified": 1469146875398,
            "latitude": 40.360204,
            "longitude": -111.761231,
            "team_id": 2
        }
    ],
    "pokestops": [
        {
            "active_pokemon_id": 19,
            "enabled": true,
            "last_modified": 1469157300759,
            "latitude": 40.370669,
            "longitude": -111.755525,
            "lure_expiration": 1469158200716,
            "pokestop_id": "1ef6996b547746c69e22dbe73af6fbb0.16"
        },
        {
            "active_pokemon_id": null,
            "enabled": true,
            "last_modified": 1469156128717,
            "latitude": 40.364965,
            "longitude": -111.756411,
            "lure_expiration": null,
            "pokestop_id": "1494e52456d64e979fdee61437bfefa7.16"
        }
    ]
}

Node v6.3 return process.dlopen(module, path._makeLong(filename));

Hi,

After I upgraded to Node 6.3, I get the following error. Any idea why?

return process.dlopen(module, path._makeLong(filename));
error: Module version mismatch. Expected 48, got 46.
at Error (native)
at Object.Module._extensions..node (module.js:568:18)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/macbook/Desktop/MEAN/pokego_map/node_modules/pokemon-go-node-api/node_modules/bignum/index.js:4:11)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)

Error first callbacks

I just saw that your mentioned adding in error handling in the #4.

I am currently working a pull request adding error first callbacks. Do you have any preferences for the error returned?

Illegal value: 9926593632519847936 (not an integer or Long)

I'm getting this error after the script runs. Everything works fine, at the end when it grabs the heartbeat (using example.js) it outputs this error.

By the way, thanks a lot for taking the time to make this!

/home/ubuntu/workspace/node_modules/bytebuffer/dist/bytebuffer-node.js:1677
                    throw TypeError("Illegal value: "+value+" (not an integer or Long)");
                    ^
TypeError: Illegal value: 9926593632519847936 (not an integer or Long)

Error to require

` let {latitude, longitude} = self.playerInfo;
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/ubuntu/workspace/app.js:3:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)`

How to manually init?

In relation to #69, how can I manually initialize an object (i.e. I already have a valid access token and api_endpoint and don't need to log in again until the token expires)?

I'm thinking it's something like this:

var pokeio = new PokemonGO.Pokeio();

pokeio.playerInfo.username = 'johndoe';
pokeio.playerInfo.password = 'secret';
pokeio.playerInfo.provider = 'ptc';
pokeio.playerInfo.accessToken = 'xyz';
pokeio.playerInfo.latitude = 40.36915523640919;
pokeio.playerInfo.longitude = -111.75098587678943;
pokeio.playerInfo.altitude = 0;
pokeio.j = request.jar(new FileCookieStore(path.resolve('/tmp/', pokeio.playerInfo.username + '.pokemongo.json')));
pokeio.request = request.defaults({ jar: pokeio.j });

pokeio.playerInfo.apiEndpoint = api_endpoint;

Perhaps the Cookie Jar isn't really necessary? (that would be wonderful if it isn't)

Stateless api

I was wondering if you considered making the api stateless. Allow the consumer of the endpoint to manage the state. This allows more flexibility for the consumer to use it for more than one authenticated user, it also makes it easier to build a rest api around it.

See below for example. I Stripped debug statements for simplicity.

self.GetAccessToken(callback) to self.getAccessToken(options, callback)

    self.getAccessToken = function (options, callback) {
        if (options.provider === 'ptc') {
            Logins.PokemonClub(options.username, options.password, self, function (err, token) {
                if (err) return callback(err);
                callback(null, token);
            });
        } else {
            Logins.GoogleAccount(options.username, options.password, self, function (err, token) {
                if (err) return callback(err);
                callback(null, token);
            });
        }
    };

self.GetApiEndpoint(callback) to self.getApiEndpoint(options, callback)

    self.getApiEndpoint = function(options, callback) {
        var req = [];
        req.push(
            new RequestEnvelop.Requests(2),
            new RequestEnvelop.Requests(126),
            new RequestEnvelop.Requests(4),
            new RequestEnvelop.Requests(129),
            new RequestEnvelop.Requests(5)
        );

        api_req(options, req, function(err, f_ret) {
            if (err) return callback(err);

            var api_endpoint = 'https://' + f_ret.api_url + '/rpc';
            callback(null, api_endpoint);
        });
    };

self.GetProfile(callback) to self.getProfile(options, callback)

    self.getProfile = function(options, callback){
        var req = new RequestEnvelop.Requests(2);
        api_req(options, req, function(err, f_ret) {
            if (err) return callback(err);

            var profile = ResponseEnvelop.ProfilePayload.decode(f_ret.payload[0]).profile
            callback(null, profile);
        });
    };

api_req(api_endpoint, access_token, req, callback) refactored to api_req(options, req, callback)

    function api_req(options, req, callback) {
        // Auth
        var auth = new RequestEnvelop.AuthInfo({
            'provider': options.provider || "google",
            'token': new RequestEnvelop.AuthInfo.JWT(options.token, 59)
        });

        var f_req = new RequestEnvelop({
            'unknown1': 2,
            'rpc_id': 1469378659230941192,

            'requests': req,

            'latitude': self.playerInfo.latitude,
            'longitude': self.playerInfo.longitude,
            'altitude': self.playerInfo.altitude,

            'auth': auth,
            'unknown12': 989
        });

        var protobuf = f_req.encode().toBuffer();

        var options = {
            url: options.endpoint,
            body: protobuf,
            encoding: null,
            headers: {
                'User-Agent': 'Niantic App'
            }
        };

        self.request.post(options, function(err, response, body) {
            if (response === undefined || body === undefined) {
                console.error('[!] RPC Server offline');
                return callback(new Error('RPC Server offline'));
            }

            try {
                var f_ret = ResponseEnvelop.decode(body);
            } catch (e) {
                if (e.decoded) { // Truncated
                    console.warn(e);
                    f_ret = e.decoded; // Decoded message with missing required fields
                }
            }

            return callback(null, f_ret);
        });
    }

const {RequestEnvelop, ResponseEnvelop} = pokemonProto;

Hello,

I'm getting the following error message when I run my node server. Please let me know what type of error this is.

Thanks

const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/Users/macbook/Desktop/MEAN/pokego_map/server/controllers/pokemons.js:3:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
[nodemon] app crashed - waiting for file changes before starting...

Most efficient method of "walking" an area

So my understanding is that the heartbeat will scan 10 neighbor cells, but the only cell for which you get actual locations of pokemon is your origin cell. How is everyone "walking" to these neighboring cells and performing requests in order to retrieve the WildPokemon response for that cell?

A simple approach would be to just increment the lat/lng but this seems too basic. Can we somehow get the lat/long based off the cell id? Is there a better approach?

Error: RPC server offline

So I am using my own username/password for pokemon.com and this is what I'm getting (I am using ptc):
`
[i] Logging with user: USERNAME HERE
[i] Session token: TGT-6020617-5fH4qoXceS-TOKENSTUFF-htO0Bjg-sso.pokemon.com
[!] RPC Server offline
/Users/aiden/DEV/pokemongo-test/routes/index.js:26
if (err) throw err;
^

Error: RPC Server offline
at Request._callback (/Users/aiden/DEV/pokemongo-test/node_modules/pokemon-go-node-api/poke.io.js:88:33)
at self.callback (/Users/aiden/DEV/pokemongo-test/node_modules/request/request.js:187:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/Users/aiden/DEV/pokemongo-test/node_modules/request/request.js:813:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:308:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
`

Does any one getting this error when trying to make anothe Pokeio.Init() ?

i'm doing this with a route like in a api i send the credentials of the user then i get the information of it , but when i try to make another post to the route when different credentials i get this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <title>Pok&eacute;mon Login</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){function r(){}function o(t,e,n){return function(){return i(t,[(new Date).getTime()].concat(u(arguments)),e?null:this,n),e?void 0:this}}var i=t("handle"),a=t(2),u=t(3),c=t("ee").get("tracer"),f=NREUM;"undefined"==typeof window.newrelic&&(newrelic=f);var s=["setPageViewName","setCustomAttribute","finished","addToTrace","inlineHit"],p="api-",l=p+"ixn-";a(s,function(t,e){f[e]=o(p+e,!0,"api")}),f.addPageAction=o(p+"addPageAction",!0),e.exports=newrelic,f.interaction=function(){return(new r).get()};var d=r.prototype={createTracer:function(t,e){var n={},r=this,o="function"==typeof e;return i(l+"tracer",[Date.now(),t,n],r),function(){if(c.emit((o?"":"no-")+"fn-start",[Date.now(),r,o],n),o)try{return e.apply(this,arguments)}finally{c.emit("fn-end",[Date.now()],n)}}}};a("setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(t,e){d[e]=o(l+e)}),newrelic.noticeError=function(t){"string"==typeof t&&(t=new Error(t)),i("err",[t,(new Date).getTime()])}},{}],2:[function(t,e,n){function r(t,e){var n=[],r="",i=0;for(r in t)o.call(t,r)&&(n[i]=e(r,t[r]),i+=1);return n}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],3:[function(t,e,n){function r(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(o<0?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=r},{}],ee:[function(t,e,n){function r(){}function o(t){function e(t){return t&&t instanceof r?t:t?u(t,a,i):i()}function n(n,r,o){t&&t(n,r,o);for(var i=e(o),a=l(n),u=a.length,c=0;c<u;c++)a[c].apply(i,r);var s=f[m[n]];return s&&s.push([w,n,r,i]),i}function p(t,e){g[t]=l(t).concat(e)}function l(t){return g[t]||[]}function d(t){return s[t]=s[t]||o(n)}function v(t,e){c(t,function(t,n){e=e||"feature",m[n]=e,e in f||(f[e]=[])})}var g={},m={},w={on:p,emit:n,get:d,listeners:l,context:e,buffer:v};return w}function i(){return new r}var a="nr@context",u=t("gos"),c=t(2),f={},s={},p=e.exports=o();p.backlog=f},{}],gos:[function(t,e,n){function r(t,e,n){if(o.call(t,e))return t[e];var r=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return t[e]=r,r}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],handle:[function(t,e,n){function r(t,e,n,r){o.buffer([t],r),o.emit(t,e,n)}var o=t("ee").get("handle");e.exports=r,r.ee=o},{}],id:[function(t,e,n){function r(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:a(t,i,function(){return o++})}var o=1,i="nr@id",a=t("gos");e.exports=r},{}],loader:[function(t,e,n){function r(){if(!h++){var t=y.info=NREUM.info,e=s.getElementsByTagName("script")[0];if(t&&t.licenseKey&&t.applicationID&&e){c(m,function(e,n){t[e]||(t[e]=n)});var n="https"===g.split(":")[0]||t.sslForHttp;y.proto=n?"https://":"http://",u("mark",["onload",a()],null,"api");var r=s.createElement("script");r.src=y.proto+t.agent,e.parentNode.insertBefore(r,e)}}}function o(){"complete"===s.readyState&&i()}function i(){u("mark",["domContent",a()],null,"api")}function a(){return(new Date).getTime()}var u=t("handle"),c=t(2),f=window,s=f.document,p="addEventListener",l="attachEvent",d=f.XMLHttpRequest,v=d&&d.prototype;NREUM.o={ST:setTimeout,CT:clearTimeout,XHR:d,REQ:f.Request,EV:f.Event,PR:f.Promise,MO:f.MutationObserver},t(1);var g=""+location,m={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-963.min.js"},w=d&&v&&v[p]&&!/CriOS/.test(navigator.userAgent),y=e.exports={offset:a(),origin:g,features:{},xhrWrappable:w};s[p]?(s[p]("DOMContentLoaded",i,!1),f[p]("load",r,!1)):(s[l]("onreadystatechange",o),f[l]("onload",r)),u("mark",["firstbyte",a()],null,"api");var h=0},{}]},{},["loader"]);</script><style type="text/css" media="screen">@import 'css/pokemon.css'/**/;</style>
        <style type="text/css" media="screen">@import 'themes/fullpage/cas.css'/**/;</style>
        <!--[if gte IE 6]><style type="text/css" media="screen">@import 'css/ie_cas.css';</style><![endif]-->
        <script type="text/javascript" src="js/common_rosters.js"></script>
    </head>
<!-- TODO put style declarations in css file -->
    <body id="cas" onload="init();" style="width: 399px;">
        <div id="content">

        <div id="welcome">
            <h2>CAS is Unavailable</h2>

            <p>
               There was an error trying to complete your request.  Please notify your support desk or try again.
            </p>

            <p></p>
        </div>


<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"applicationID":"1087080","applicationTime":0,"beacon":"bam.nr-data.net","queueTime":0,"licenseKey":"ba34eb72cb","transactionName":"MgFaZkVVWBBXABIPWAtLcmFnG2EmdE4vKHFKElFXQBtcEEZMAxRFChZLHF1HRg==","agent":"","errorBeacon":"bam.nr-data.net"}</script></body>
</html>


undefined:9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

How to obtain the data of nearby pokemon

Installed and run the app through the example configuring my email, password, google provider and adding a valid location. Everything runs smoothly. Expected that the "heartbeat" function would return me an array of nearby interest objects, but it returns this:

screen shot 2016-07-20 at 8 37 59 am

cells array of objects with some properties, but most of them are empty. Am I using the wrong function? how can I get the data of nearby pokemon?

Google login 403

I'm getting a 403 response when I'm trying to login with my google account, any tips on how to fix this?

Using correct credentials by the way.

can someone push me the right way?

Problem with Poke.io.js

I am getting the following error when trying to run the example file.

/node_modules/pokemon-go-node-api/poke.io.js:18
const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/Users/User/Sites/pokemongo_node_alert/server.js:3:14)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)

What version of node does this support?

I am trying to use the Heartbeat and the GetPokemons calls and they are both blowing up:

/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/node_modules/bytebuffer/dist/bytebuffer-node.js:346
throw TypeError("Illegal buffer");
^

TypeError: Illegal buffer
at TypeError (native)
at Function.module.exports.ByteBuffer.wrap (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/node_modules/bytebuffer/dist/bytebuffer-node.js:346:19)
at ProtoBuf.Reflect.ElementPrototype.verifyValue (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/dist/protobuf.js:1870:39)
at ProtoBuf.Reflect.FieldPrototype.verifyValue (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/dist/protobuf.js:3474:33)
at MessagePrototype.set (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/dist/protobuf.js:2475:59)
at Message (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/node_modules/protobufjs/dist/protobuf.js:2399:42)
at Pokeio.self.Heartbeat (/Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/poke.io.js:220:21)
at /Users/user/sourcecode/playground/pokemongo/pgo/index.js:36:10
at /Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/poke.io.js:123:21
at /Users/user/sourcecode/playground/pokemongo/pgo/node_modules/pokemon-go-node-api/poke.io.js:173:13

I am trying to wrap my head around the calls to the endpoint and once I figure that out, I could help with the project.

Decouple geolocation translation

The async location code should probably be pulled out since this can be done in the browser, mobile app, node client, etc and isn't core to this library.

It just adds weight to this module.

ES6 class pattern

I'm wondering why you don't use some es6 features like classes in this project. Is there a reason for this?
es6 classes are supported since node 4 (which is LTS at this moment)

SetLocation

Hi!

This may sound stupid, but how does the setLocation function actually work?

I have this code:

Pokeio.SetLocation(location2, function(err, location){
          if (err) throw err;
          console.log('err' + err);
          console.log(location);
          console.log('location2');
          console.log(location2);

          location.latitude = 52.40937;
          location.longitude = 4.895058;
          location.altitude = 0;

          console.log(location);


        });

What does it actually do in the game?

Thanks.

Node.js 6.x support

Hi

Is linux supported? I'm getting the following issue with s2geometry-node but can't find any more details about...

➜  Pokemon-GO-node-api git:(master) npm i
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> [email protected] install /home/bencevans/Code/Pokemon-GO-node-api/node_modules/s2geometry-node
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
make: Entering directory '/home/bencevans/Code/Pokemon-GO-node-api/node_modules/s2geometry-node/build'
  CXX(target) Release/obj.target/NativeExtension/src/NativeExtension.o
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<float>::IsFinite(MathLimits<float>::Type)’:
../geometry/util/math/mathlimits.h:194:55: error: ‘isinf’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:194:55: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h:194:70: error: ‘isnan’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:194:70: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<float>::IsNaN(MathLimits<float>::Type)’:
../geometry/util/math/mathlimits.h:195:51: error: ‘isnan’ was not declared in this scope
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:195:51: note: suggested alternative:
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<float>::IsInf(MathLimits<float>::Type)’:
../geometry/util/math/mathlimits.h:196:51: error: ‘isinf’ was not declared in this scope
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:196:51: note: suggested alternative:
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<float>::IsPosInf(MathLimits<float>::Type)’:
../geometry/util/math/mathlimits.h:197:54: error: ‘isinf’ was not declared in this scope
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:197:54: note: suggested alternative:
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<float>::IsNegInf(MathLimits<float>::Type)’:
../geometry/util/math/mathlimits.h:198:54: error: ‘isinf’ was not declared in this scope
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
../geometry/util/math/mathlimits.h:198:54: note: suggested alternative:
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:229:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(float, FLT)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<double>::IsFinite(MathLimits<double>::Type)’:
../geometry/util/math/mathlimits.h:194:55: error: ‘isinf’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:194:55: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h:194:70: error: ‘isnan’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:194:70: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<double>::IsNaN(MathLimits<double>::Type)’:
../geometry/util/math/mathlimits.h:195:51: error: ‘isnan’ was not declared in this scope
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:195:51: note: suggested alternative:
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<double>::IsInf(MathLimits<double>::Type)’:
../geometry/util/math/mathlimits.h:196:51: error: ‘isinf’ was not declared in this scope
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:196:51: note: suggested alternative:
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<double>::IsPosInf(MathLimits<double>::Type)’:
../geometry/util/math/mathlimits.h:197:54: error: ‘isinf’ was not declared in this scope
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:197:54: note: suggested alternative:
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<double>::IsNegInf(MathLimits<double>::Type)’:
../geometry/util/math/mathlimits.h:198:54: error: ‘isinf’ was not declared in this scope
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
../geometry/util/math/mathlimits.h:198:54: note: suggested alternative:
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:230:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(double, DBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<long double>::IsFinite(MathLimits<long double>::Type)’:
../geometry/util/math/mathlimits.h:194:55: error: ‘isinf’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:194:55: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                       ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h:194:70: error: ‘isnan’ was not declared in this scope
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:194:70: note: suggested alternative:
   static bool IsFinite(const Type x) { return !isinf(x)  &&  !isnan(x); } \
                                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<long double>::IsNaN(MathLimits<long double>::Type)’:
../geometry/util/math/mathlimits.h:195:51: error: ‘isnan’ was not declared in this scope
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:195:51: note: suggested alternative:
   static bool IsNaN(const Type x) { return isnan(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<long double>::IsInf(MathLimits<long double>::Type)’:
../geometry/util/math/mathlimits.h:196:51: error: ‘isinf’ was not declared in this scope
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:196:51: note: suggested alternative:
   static bool IsInf(const Type x) { return isinf(x); } \
                                                   ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<long double>::IsPosInf(MathLimits<long double>::Type)’:
../geometry/util/math/mathlimits.h:197:54: error: ‘isinf’ was not declared in this scope
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:197:54: note: suggested alternative:
   static bool IsPosInf(const Type x) { return isinf(x)  &&  x > 0; } \
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
In file included from ../geometry/util/math/mathutil.h:22:0,
                 from ../geometry/util/math/vector3-inl.h:40,
                 from ../geometry/s2.h:19,
                 from ../src/point.h:7,
                 from ../src/NativeExtension.cc:2:
../geometry/util/math/mathlimits.h: In static member function ‘static bool MathLimits<long double>::IsNegInf(MathLimits<long double>::Type)’:
../geometry/util/math/mathlimits.h:198:54: error: ‘isinf’ was not declared in this scope
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
../geometry/util/math/mathlimits.h:198:54: note: suggested alternative:
   static bool IsNegInf(const Type x) { return isinf(x)  &&  x < 0; }
                                                      ^
../geometry/util/math/mathlimits.h:226:3: note: in expansion of macro ‘DECL_FP_LIMIT_FUNCS’
   DECL_FP_LIMIT_FUNCS \
   ^
../geometry/util/math/mathlimits.h:231:1: note: in expansion of macro ‘DECL_FP_LIMITS’
 DECL_FP_LIMITS(long double, LDBL)
 ^
In file included from /usr/include/c++/5/random:38:0,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from ../../nan/nan.h:50,
                 from ../src/point.h:6,
                 from ../src/NativeExtension.cc:2:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
NativeExtension.target.mk:137: recipe for target 'Release/obj.target/NativeExtension/src/NativeExtension.o' failed
make: *** [Release/obj.target/NativeExtension/src/NativeExtension.o] Error 1
make: Leaving directory '/home/bencevans/Code/Pokemon-GO-node-api/node_modules/s2geometry-node/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/bencevans/.nvm/versions/node/v6.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.0-31-generic
gyp ERR! command "/home/bencevans/.nvm/versions/node/v6.3.0/bin/node" "/home/bencevans/.nvm/versions/node/v6.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/bencevans/Code/Pokemon-GO-node-api/node_modules/s2geometry-node
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
[email protected] /home/bencevans/Code/Pokemon-GO-node-api
├─┬ [email protected] 
│ └── [email protected] 
├── [email protected] 
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│   └── [email protected] 
├─┬ [email protected] 
│ └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └─┬ [email protected] 
│ │     ├── [email protected] 
│ │     └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ └── [email protected] 
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├─┬ [email protected] 
│   │ │ │ ├─┬ [email protected] 
│   │ │ │ │ └── [email protected] 
│   │ │ │ ├── [email protected] 
│   │ │ │ └── [email protected] 
│   │ │ └── [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   ├─┬ [email protected] 
│ │   │ └── [email protected] 
│ │   ├── [email protected] 
│ │   ├─┬ [email protected] 
│ │   │ └── [email protected] 
│ │   ├── [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
└─┬ [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├── [email protected] 
  │   │ └── [email protected] 
  │   ├── [email protected] 
  │   └── [email protected] 
  └── [email protected] 

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/home/bencevans/.nvm/versions/node/v6.3.0/bin/node" "/home/bencevans/.nvm/versions/node/v6.3.0/bin/npm" "i"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the s2geometry-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs s2geometry-node
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls s2geometry-node
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/bencevans/Code/Pokemon-GO-node-api/npm-debug.log

Browser app

Haven't looked too deeply into the dependencies but just curious, do you think it would be possible to create a client that runs from the browser? I.e. Is your code 100% JavaScript

Error when require.

/var/www/node_modules/pokemon-go-node-api/poke.io.js:21
const (RequestEnvelop, ResponseEnvelop) = pokemonProto;
      ^

SyntaxError: Unexpected token (
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/var/www/pokemongo/core.js:1:77)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

OAuth2 Tokens

Can we expect to be able to use an Oauth2 token through passport.js or similar?
inputting actual usernames and passwords is not going to work with 2fa

Cannot build s2geometry-node

I've tried many times and many tips over the internet to build s2geometry using node-gyp but each time it fails on errors like

..\geometry\s1interval.cc(249): error C2065: 'M_PI': undeclared identifier [C:\
nodejs\poke\node_modules\s2geometry-node\build\NativeExtension.vcxproj

I'm pasting a npm-debug.log

npm-debug.txt

npm -v 3.10.5

node -v v4.4.7

Expose Token Expiry

I believe the refresh_token and access_token both come with expiry times which should be exposed (so we can login again without a failed attempt when the token has expired), but are not yet.

Heartbeat cells suddenly empty?

Since the latest update, my heartbeat cells array is empty. Auth works fine and then I am using the code from example:

Pokeio.Heartbeat(function(err,hb) {
            if(err) {
                console.log(err);
            }

            console.log(hb);

            for (var i = hb.cells.length - 1; i >= 0; i--) {
                if(hb.cells[i].NearbyPokemon[0]) {
                    //console.log(Pokeio.pokemonlist[0])
                    var pokemon = Pokeio.pokemonlist[parseInt(hb.cells[i].NearbyPokemon[0].PokedexNumber)-1]
                    console.log('[+] There is a ' + pokemon.name + ' at ' + hb.cells[i].NearbyPokemon[0].DistanceMeters.toString() + ' meters')
                }
            }

        });

returns

{ cells: [] }

Please, ES6 or not ES6 but not both

In the last pull request some ES6 syntax have been added, forcing to update to node 6.3.0. It has created a lot of problems, people asking why doesnt work #51 , people with problems compiling #45 .. So i would like you decide if you will use ES6 or not, if not, please, remove these changes which are causing a lot of problems.

Personally I prefer not to use ES6, but if you decide to use it i am ok also.

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.