Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export data from Pokeminer #55

Open
ferazambuja opened this issue Aug 3, 2016 · 2 comments
Open

Export data from Pokeminer #55

ferazambuja opened this issue Aug 3, 2016 · 2 comments

Comments

@ferazambuja
Copy link
Contributor

Just pulled a request where I added encounter_id and time_till_hidden. It's extremely simple and close to 10 lines of code.

Until the solution for the webhook comes this would be a nice temporary fix.

@Brideau
Copy link
Owner

Brideau commented Aug 3, 2016

Hmm, not seeing the pull request...

@ferazambuja
Copy link
Contributor Author

I'm not sure how to convert encounter_id to base64 on python. Encounter_id is too big for SQLite to handle. I'm not that great of a programmer.
Can you look at db.py?
Just add:

line 43
    @staticmethod
    def _make_key(sighting):
        return (
            sighting.pokemon_id,
            sighting.spawn_id,
            sighting.normalized_timestamp,
            sighting.lat,
            sighting.lon,
            sighting.encounter_id,
            sighting.time_till_hidden_ms,
        )
line 77
class Sighting(Base):
    __tablename__ = 'sightings'

    id = Column(Integer, primary_key=True)
    pokemon_id = Column(Integer)
    spawn_id = Column(String(32))
    expire_timestamp = Column(Integer)
    normalized_timestamp = Column(Integer)
    lat = Column(String(16))
    lon = Column(String(16))
    encounter_id = Column(String(32))
    time_till_hidden_ms = Column(Integer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants