Skip to content

Commit

Permalink
Adding an option to save pokemon spawns
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Mateus Pires committed Sep 2, 2016
2 parents 730f215 + e83c7e6 commit 838fea4
Show file tree
Hide file tree
Showing 360 changed files with 22,787 additions and 3,922 deletions.
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
.idea
.git*
**/*config.json
**/*userdata.js
**/*userdata.js
data/caught-*.json
data/cells-*.json
data/deviceid-*.txt
data/last-location-*.json
data/*.db
web/catchable-*.json
web/inventory-*.json
web/location-*.json
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ out/
# Personal load details
src/
web/
data/*.db
data/last-location*.json
data/cells-*.json
data/map-caught-*.json
data/pokemon_spawns-*.json
data/recent-forts-*.json
data/caught-*.json
data/deviceid-*.txt
data/mqtt_client_id.*
user_web_catchable
version

# Multiple config
configs/*
Expand All @@ -124,6 +129,7 @@ configs/*
!configs/path.example.json
!config.json.cluster.example
!config.json.optimizer.example
!auth.json.example

# Virtualenv folders
bin/
Expand All @@ -134,3 +140,8 @@ pip-selfcheck.json

# Some love for the vim users
.*.sw*

# Mac Gargage
.DS_Store
data/mqtt_client_id
Encrypt_64.dll
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "web"]
path = web
url = https://github.com/OpenPoGo/OpenPoGoWeb.git
url = https://github.com/PokemonGoF/PokemonGo-Web
2 changes: 1 addition & 1 deletion .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ reject_value: -1
reset_on_push: true
author_approval: ignored
reviewers:
required: 2
required: 1
teams:
- pokemongo-bot-team
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ install:
- pip install pylint
script:
- python pylint-recursive.py
- python json-validate.py configs/*.json.*
- python -m unittest discover -v -p "*_test.py"
6 changes: 6 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@
* Quantra
* pmquan
* net8q
* SyncX
* umbreon222
* DeXtroTip
* rawgni
* Breeze Ro
* bruno-kenji
68 changes: 50 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
FROM python:2.7
# To build a docker container for the "master" branch (this is the default) execute:
#
# docker build --build-arg BUILD_BRANCH=master .
# (or)
# docker build .
#
# To build a docker container for the "dev" branch execute:
#
# docker build --build-arg BUILD_BRANCH=dev .
#
# You can also build from different fork and specify a particular commit as the branch
#
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .

FROM alpine

ARG BUILD_REPO=PokemonGoF/PokemonGo-Bot
ARG BUILD_BRANCH=master

LABEL build_repo=$BUILD_REPO build_branch=$BUILD_BRANCH

WORKDIR /usr/src/app
VOLUME ["/usr/src/app/configs", "/usr/src/app/web"]

ARG timezone=Etc/UTC
RUN echo $timezone > /etc/timezone \
&& ln -sfn /usr/share/zoneinfo/$timezone /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata

RUN cd /tmp && wget "http://pgoapi.com/pgoencrypt.tar.gz" \
&& tar zxvf pgoencrypt.tar.gz \
&& cd pgoencrypt/src \
&& make \
&& cp libencrypt.so /usr/src/app/encrypt.so \
&& cd /tmp \
&& rm -rf /tmp/pgoencrypt*
RUN apk -U --no-cache add python py-pip tzdata \
&& rm -rf /var/cache/apk/* \
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f

ENV LD_LIBRARY_PATH /usr/src/app
ADD http://pgoapi.com/pgoencrypt.tar.gz /tmp/pgoencrypt.tar.gz
ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git \
&& tar zxf /tmp/pgoencrypt.tar.gz -C /tmp \
&& make -C /tmp/pgoencrypt/src \
&& cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so \
&& ln -s locale.h /usr/include/xlocale.h \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-dependencies \
&& rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h \
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f

COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
ADD https://api.github.com/repos/$BUILD_REPO/commits/$BUILD_BRANCH /tmp/pgobot-version
RUN apk -U --no-cache add --virtual .pgobot-dependencies wget ca-certificates tar jq \
&& wget -q -O- https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz | tar zxf - --strip-components=1 -C /usr/src/app \
&& jq -r .sha /tmp/pgobot-version > /usr/src/app/version \
&& apk del .pgobot-dependencies \
&& rm -rf /var/cache/apk/* /tmp/pgobot-version

COPY . /usr/src/app
RUN printf "#!/bin/sh\n\
\n\
TIMEZONE=\${TIMEZONE:-Etc/UTC}\n\
\n\
ln -sfn /usr/share/zoneinfo/\$TIMEZONE /etc/localtime\n\
echo \$TIMEZONE > /etc/timezone\n\
\n\
python pokecli.py \$@\n" > /entrypoint.sh \
&& chmod +x /entrypoint.sh

ENTRYPOINT ["python", "pokecli.py"]
ENTRYPOINT ["/entrypoint.sh"]
51 changes: 32 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# PokemonGo-Bot
PokemonGo bot is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team.
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team.

The project is currently setup in two main branches.
- `dev` also known as `beta` - This is where the latest features are, but you may also experience some issues with stability/crashes
- `master` also known as `stable` - The bot 'should' be stable on this branch, and is generally well tested
## Table of Contents
- [Installation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/installation.md)
- [Documentation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/)
- [Support](#support)
- [Help](#configuration-issueshelp)
- [Bugs](#bugs--issues)
- [Feature Requests](#feature-requests)
- [Pull Requests](#pull-requests)
- [Features](#features)
- [Credits](#credits)

The project is currently setup in two main branches:
- `dev` also known as `beta` - This is where the latest features are, but you may also experience some issues with stability/crashes.
- `master` also known as `stable` - The bot 'should' be stable on this branch, and is generally well tested.

## Support
###Configuration issues/help
### Configuration issues/help
If you need any help please don't create an issue as we have a great community on Slack. You can count on the community in [#help](https://pokemongo-bot.slack.com/messages/help/) channel.
- [Click here to signup (first time only)](https://pokemongo-bot.herokuapp.com)
- [Join if you're already a member](https://pokemongo-bot.slack.com/messages/general/).
- [Click here to signup (first time only)](https://pokemongo-bot.herokuapp.com)
- [Join here if you're already a member](https://pokemongo-bot.slack.com/messages/general/)

###[Bugs / Issues](https://github.com/PokemonGoF/PokemonGo-Bot/issues?q=is%3Aissue+sort%3Aupdated-desc)
If you discover a bug in the bot, please [search our issue tracker](https://github.com/PokemonGoF/PokemonGo-Bot/issues?q=is%3Aissue+sort%3Aupdated-desc) first. If it hasn't been reported, please [create a new issue](https://github.com/PokemonGoF/PokemonGo-Bot/issues/new) and ensure you follow the template guide so that our team can assist you as quickly as possible.
Expand All @@ -21,12 +32,6 @@ While you're there vote on other feature requests to let the devs know what is m
###[Pull Requests](https://github.com/PokemonGoF/PokemonGo-Bot/pulls)
If you'd like to make your own changes, make sure you follow the pull request template, and ensure your PR is made against the 'dev' branch

## Table of Contents
- [Installation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/installation.md)
- [Documentation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/)
- [Features](#features)
- [Credits](#credits)

## Features
- [x] GPS Location configuration
- [x] Search Pokestops
Expand All @@ -41,32 +46,40 @@ If you'd like to make your own changes, make sure you follow the pull request te
- [x] Adjust delay between Pokemon capture & Transfer as per configuration
- [x] Hatch eggs
- [x] Incubate eggs
- [x] Crowd Sourced Map Prototype
- [ ] [Standalone Desktop Application] (https://github.com/PokemonGoF/PokemonGo-Bot-Desktop)
- [ ] Use candy
- [ ] Inventory cleaner

## Gym Battles
This bot takes a strong stance against automating gym battles. Botting gyms will have a negative effect on most players and thus the game as a whole. We will thus never accept contributions or changes containing code specific for gym battles.
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) takes a strong stance against automating gym battles. Botting gyms will have a negative effect on most players and thus the game as a whole. We will thus never accept contributions or changes containing code specific for gym battles.

## Analytics
This bot is very popular and has a vibrant community. Because of that, it has become very difficult for us to know how the bot is used and what errors people hit. By capturing small amounts of data, we can prioritize our work better such as fixing errors that happen to a large percentage of our user base, not just a vocal minority.
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is very popular and has a vibrant community. Because of that, it has become very difficult for us to know how the bot is used and what errors people hit. By capturing small amounts of data, we can prioritize our work better such as fixing errors that happen to a large percentage of our user base, not just a vocal minority.

Our goal is to help inform our decisions by capturing data that helps us get aggregate usage and error reports, not personal information. To view the code that handles analytics in our master branch, you can use this [search link](https://github.com/PokemonGoF/PokemonGo-Bot/search?utf8=%E2%9C%93&q=BotEvent).

If there are any concerns with this policy or you believe we are tracking something we shouldn't, please open a ticket in the tracker. The contributors always intend to do the right thing for our users, and we want to make sure we are held to that path.

If you do not want any data to be gathered, you can turn off this feature by setting `health_record` to `false` in your `config.json`.

## Help Needed on [Desktop Version](https://github.com/PokemonGoF/PokemonGo-Bot-Desktop)


## Credits
- [tejado](https://github.com/tejado) many thanks for the API
- [U6 Group](http://pgoapi.com) for the U6
- [Mila432](https://github.com/Mila432/Pokemon_Go_API) for the login secrets
- [elliottcarlson](https://github.com/elliottcarlson) for the Google Auth PR
- [AeonLucid](https://github.com/AeonLucid/POGOProtos) for improved protos
- [AHAAAAAAA](https://github.com/AHAAAAAAA/PokemonGo-Map) for parts of the s2sphere stuff
- [Breeze ro](https://github.com/BreezeRo) for some of the MQTT/Map stuff

## [Contributors](https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/CONTRIBUTORS.md)

## Disclaimer
©2016 Niantic, Inc. ©2016 Pokémon. ©1995–2016 Nintendo / Creatures Inc. / GAME FREAK inc. © 2016 Pokémon/Nintendo Pokémon and Pokémon character names are trademarks of Nintendo. The Google Maps Pin is a trademark of Google Inc. and the trade dress in the product design is a trademark of Google Inc. under license to The Pokémon Company. Other trademarks are the property of their respective owners.
[Privacy Policy](http://www.pokemon.com/us/privacy-policy/)

[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is intended for academic purposes and should not be used to play the game *PokemonGo* as it violates the TOS and is unfair to the community. Use the bot **at your own risk**.

[PokemonGoF](https://github.com/PokemonGoF) does not support the use of 3rd party apps or apps that violate the TOS.


[![Analytics](https://ga-beacon.appspot.com/UA-81468120-1/welcome-page-master)](https://github.com/igrigorik/ga-beacon)
12 changes: 12 additions & 0 deletions configs/auth.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"auth_service": "google",
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"location": "SOME_LOCATION",
"favorite_locations":[
{"name": "Milan", "coords": "45.472849,9.177567"}
],
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"telegram_token": ""
}
Loading

0 comments on commit 838fea4

Please sign in to comment.