Pokèmon Go is everywhere, especially in New York City, but who has time for this:

I spent some time looking into how the game worked from a developer's perspective and came across this demo https://github.com/tejado/pgoapi which allows full communication with Niantic's API. Since it was just a demo and written in Python, I decided to try to build a Ruby version to suit my own needs but quickly ran into a major problem: how to obtain the OAuth token.

It was pretty easy to port most of this to a Ruby gem with the exception of the EncryptedPasswd parameter part, which is described in this article. I finally got it working after looking at the Python version, the Java version and the C# Port as well as many hours of trial and error and reading up on crytpo terms and Ruby docs.

The gem is published to Ruby Gems and the source is available on Github. It could potentially be used to authenticate any Ruby app that needs to communicate with Play services like Google Music, Google+, Drive, etc.

Now, five days later, finally time to start hacking on some actual Pokèmon Go stuff...