Giter VIP home page Giter VIP logo

pokelocater's Introduction

PokeLocator

The stabile-mobile branch has a stable version of the app, with a smaller scan radius around your immediate area that works great on mobile and heroku.

The master branch has the latest develop version, which may or may not be stabile. It will have a larger scan radius, but may not work on Heroku due to Heroku's 30 second timeouts.

Things you will need

Google Maps API Key

Pokemon Trainer Club Account OR Google Account (a throwaway)

Setup on Heroku with button deploy

  • Click the DEPLOY Heroku button below to build the app in the cloud for free (requires Heroku account).

Deploy

Setup on Heroku manually

- Install heroku toolbelt (https://toolbelt.heroku.com/)
- Install git
- Install python 2.7.6
- Install pip (e.g. sudo easy_install pip)
<clone our app to a local git repository>
$ sudo pip install -r requirements.txt
$ heroku apps:create pokelocator-demo
$ heroku config:set IS_HEROKU_SERVER=1
$ heroku config:set GMAPS_API_KEY=my_google_maps_api_key
$ heroku config:set PTC_USERNAME=my_pokeclub_username
$ heroku config:set PTC_PASSWORD=my_pokeclub_password
$ heroku config:set GOOG_USERNAME=my_google_username
$ heroku config:set GOOG_PASSWORD=my_google_password
$ git push heroku master

Now visit your heroku app url in the browser. You must use https:// instead of http:// to allow location tracking (modern browsers block it if not https).

Setup locally

- Install git
- Install python 2.7.6
- Install pip (e.g. sudo easy_install pip)

Setup environmental variables (google how to do it for your system):

GMAPS_API_KEY=my_google_maps_api_key
PTC_USERNAME=my_pokeclub_username
PTC_PASSWORD=my_pokeclub_password
GOOG_USERNAME=my_google_username
GOOG_PASSWORD=my_google_password
$ sudo pip install -r requirements.txt
$ python manage.py runserver
Visit http://127.0.0.1:8000/

Notes

  • Note that you will need to view the "https" and not "http" version of your herokuapp for most browsers to allow the code to request your location.
  • Get an email from gmail saying someone attempted to login to your account from virginia (or wherever)? That would be this app. If you deployed to heroku, then your heroku cloud instance IS logging into your gmail account. You are not getting hacked, if you are worried you can review the code here, please don't send me threats.

Pokelocator api from: https://github.com/leegao/pokemongo-api-demo/tree/simulation

pokelocater's People

Contributors

clintoxx avatar jessechrestler avatar mmerlin6 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

pokelocater's Issues

Pokemon show in command line but not on map

When I watch the papertrail logs, it states:

Within one step of LatLng: LOCATION (298m NE from you):
(133) Eevee
(41) Zubat

This is the same result as I get in the Pokemon Go app.

But it doesn't shop up on the map.

Any ideas why?

GeocoderQuotaExceeded

Traceback:
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/app/api/views.py" in get_poke
  2. result = pokelocator_api.main(location=location, direction=direction)
    
    File "/app/api/pokelocator_api.py" in main
  3. set_location(location)
    
    File "/app/api/pokelocator_api.py" in set_location
  4. loc = geolocator.geocode(location_name)
    
    File "/app/.heroku/python/lib/python2.7/site-packages/geopy/geocoders/googlev3.py" in geocode
  5.         self._call_geocoder(url, timeout=timeout), exactly_one
    
    File "/app/.heroku/python/lib/python2.7/site-packages/geopy/geocoders/googlev3.py" in _parse_json
  6.         self._check_status(page.get('status'))
    
    File "/app/.heroku/python/lib/python2.7/site-packages/geopy/geocoders/googlev3.py" in _check_status
  7.             'The given key has gone over the requests limit in the 24'
    

Exception Type: GeocoderQuotaExceeded at /get_poke
Exception Value: The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.

Where does this key come from?

Can't set it up locally. Won't login with RPC and is Google working?

Hey,

I tried to set that project up locally, since I can't use Heroku, faced one issue, it can't login to RPC:

api_req: login_type ptc
Sleeping for 2 seconds to get around rate-limit.
BAD CACHE
[!] login for: Invalid
access_token None
[-] Trouble logging in via PTC
[+] Authentication with google...
[17/Jul/2016 18:59:57]"POST /get_poke HTTP/1.1" 500 10891

does it even try to login with google? Can I switch? Thank you!

"[!]login for: Invalid" <- on other python scripts with the API it says "[!]login for: username" don't know why here Invalid.

Run it on own CentOs?

Hi guys,

i want to run this beautiful tool on my own server and here my questions:

How can i change the port used by the script?
What do i have to change to get it running on my server?

Force HTTPS

Currently loads up (or redirects from root) to http, need to force https

Google Login Issues

Hi,

Leaving PTC_USERNAME and PTC_PASSWORD blank doesn't make it default to Google Login. For me it just loops failing to login to the PTC.

[!] Your given location: XXX, XXX, France
[!] lat/long/alt: 48.xxxxxxx -1.xxxxxxx 0.0
Sleeping for 2 seconds to get around rate-limit.
BAD CACHE
[!] login for:
[!] Your given location: XXX, XXX, France
[!] lat/long/alt: 48.xxxxxx -1.xxxxxx 0.0
BAD CACHE
[!] login for:
access_token None
[-] Trouble logging in via PTC
access_token None
[-] Trouble logging in via PTC
[!] Your given location: XXX, XXX, France
[!] lat/long/alt: 48.xxxxxxx -1.xxxxxx 0.0
at=info method=GET path="/static/poke/trainer.gif" host=pokelocator-rennes.herokuapp.com request_id=aea5f7a9-3f0e-4f05-abac-xxxxxxx fwd="xx.xx.xxx.xxx" dyno=web.1 connect=2ms service=19662ms status=200 bytes=748
at=info method=POST path="/get_poke" host=pokelocator-rennes.herokuapp.com request_id=89607d1d-61e6-458e-9717-xxxxxxxxx fwd="xx.xx.xxx.xxx" dyno=web.1 connect=1ms service=20409ms status=500 bytes=9011
sock=client at=warning code=H27 desc="Client Request Interrupted" method=POST path="/get_poke" host=pokelocator-rennes.herokuapp.com request_id=7478b337-36f7-4eae-86dc-xxxxxxxxx fwd="xx.xx.xxx.xxx" dyno=web.1 connect=1ms service=26136ms status=499 bytes=234
BAD CACHE
[!] login for:
access_token None
[-] Trouble logging in via PTC
[!] Your given location: XXX, XXX, France
[!] lat/long/alt: 48.xxxxxxx -1.xxxxxxx 0.0
at=info method=POST path="/get_poke" host=pokelocator-rennes.herokuapp.com request_id=b5fe56c7-b3f1-494c-827e-xxxxxxxxxx fwd="xx.xx.xxx.xxx" dyno=web.1 connect=13ms service=18022ms status=500 bytes=9012
BAD CACHE
[!] login for:
[3] [CRITICAL] WORKER TIMEOUT (pid:21)
access_token None
[!] Your given location: XXX, XXX, France
[!] lat/long/alt: 48.xxxxxxx -1.xxxxxxx 0.0
[30] [INFO] Booting worker with pid: 30
BAD CACHE
[!] login for:
at=error code=H12 desc="Request timeout" method=POST path="/get_poke" host=pokelocator-rennes.herokuapp.com request_id=c8d20540-2012-4eca-9601-xxxxxxxxxx fwd="xx.xx.xxx.xxx" dyno=web.1 connect=8ms service=30000ms status=503 bytes=0
access_token None
[-] Trouble logging in via PTC
etc...

Any help is greatly appreciated :)

Works on computer using chrome browser but not IOS devices

Overall it's awesome thanks for sharing the code. I cloned the project on heroku and got everything up and running however on iOS devices it's stuck on Detecting Location... i tried Chrome and Safari but same issue. Any help will be appreciated :)

Django: No module named google.protobuf

After installing, migrating and running I got these error on http://127.0.0.1:8000/

ImportError at /
No module named google.protobuf
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.8
Exception Type: ImportError
Exception Value:
No module named google.protobuf

This is what the command line looks like:

python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
July 18, 2016 - 11:19:21
Django version 1.8, using settings 'hackathon.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[18/Jul/2016 11:19:24]"GET / HTTP/1.1" 500 112033

Maps API quota exceeded

You have your API key hardcoded into /static/index.html, users should be instructed to get their own key and replace it. RIght now the shared key has exceeded its quota limit and can't be used.

Error while fetching get_poke

Traceback:
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/app/api/views.py" in get_poke
  2. result = pokelocator_api.main(location=location, direction=direction)
    
    File "/app/api/pokelocator_api.py" in main
  3.         access_token = login_google(goog_username, goog_password)
    
    File "/app/api/pokelocator_api.py" in login_google
  4. fourth=r2.history[len(r2.history)-1].headers['Location'].replace('amp%3B','').replace('amp;','')
    

Deployed to Heroku manually and all variables are set.

Pokemon Training Club Account - 500 Errors

Hey guys,

The PTC account has stopped taking new accounts at the moment. Is the PTC account a dependency even if you can login with your google account? I just seeded with a non-existent PTC account and assumed it would fail back to my google account. Getting a 500 on /get_poke. Directly before that it says trouble logging in via PTC so looks like I'm not assuming correct. ;)

Always 0 Pokemon's found. (Server Issue)

Hello, thanks for this awesome work! But from the past 4 hours or 6~ the app has stopped grabbing Pokemon data.

I checked the heroku logs but everything seems fine. Made a new order account, and Google map API key is still at 800 /25,000. Using it personally for myself only.

Can the heroku up be banned by any chance?

See player icon, but no pokemon anywhere

New to this type of coding, so this might be an easy error (I use perl of all languages for some grad school stuff).

I see my player icon, but no pokemon anywhere on the map. Looking at the console inside chrome I see that I have a "Failed to Load Resource: the server responded with a status of 404 (NOT FOUND)". It then lists my url https://my-tracker-i-built.herokuapp.com/favicon.ico

I also get a Google maps API warning: sensor not required as well as pokemon_data returning null

Any help?

Not asking for location access on chrome

Neither on my android phone nor on my PC is it asking for my location. It just sits there waiting for location. On firefox it is working fine. Any solution to this?

Edit: Ah I see chrome requires SSL when providing location. How can I run this locally with https? When I visit my website it tells me in the command line: You're accessing the development server over HTTPS, but it only supports HTTP.

PTC Login Issue

Im getting following error:

api_req: login_type ptc
Sleeping for 2 seconds to get around rate-limit.
BAD CACHE
[!] login for: Invalid
access_token None
[-] Trouble logging in via PTC
[+] Authentication with google..

I have tried with 2 PTC accounts

System dependencies (postgres, etc)

In order to get pip install -r requirements.txt to work on my Ubuntu machine I had to install a few more dependencies first:

sudo apt-get install postgresql
sudo apt-get install libpq-dev
sudo apt-get install python-dev

Thought this information could be useful to others.

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.