GithubHelp home page GithubHelp logo

havrylenkok / pokemon-go-node-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from armax/pokemon-go-node-api

0.0 1.0 0.0 62 KB

Pokemon GO api node.js library

License: MIT License

JavaScript 83.43% Protocol Buffer 16.57%

pokemon-go-node-api's Introduction

Poke.io

Pokemon GO api node.js library, still WIP
Check main.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.
    • latitude {Number}
    • longitude {Number}
    • altitude {Number}
  • callback {Function(error, coordinates)}
    • error {Error}
    • coordinates {Object}
      • latitude {Number}
      • longitude {Number}
      • altitude {Number}

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 awk34 avatar fidian avatar havrylenkok avatar jdpnielsen avatar jimmywarting avatar wain-pc avatar xbytez avatar

Watchers

 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.