pokelyzer icon indicating copy to clipboard operation
pokelyzer copied to clipboard

Provide option for excluding common Pokemon from the database

Open Brideau opened this issue 7 years ago • 3 comments

There's a ton of pidgeys and weedles out there - let's save our hard drives and not bother saving their data.

Brideau avatar Jul 30 '16 13:07 Brideau

I have got Pokelyzer working now (thanks for your advice earlier).

I am excluding common pokemon like this:

First, I added an extra argument in utils.py: parser.add_argument('--pokel-excl', help='Exclude common pokemon when updating DB', default=False)

Then I added the following to the top of logPokemonDb(p), just below the reading of the ID:

if args.pokel_excl:
        if pokemon_id in [13,16,19,21,41,96]:
            return

So it now looks like the following

def logPokemonDb(p):
    pokemon_id = int(p['pokemon_data']['pokemon_id'])

    if args.pokel_excl:
        if pokemon_id in [13,16,19,21,41,96]:
            return
    pokemon_name = get_pokemon_name(str(pokemon_id)).lower()

Where: 13=Weedle, 16=Pidgey, 19=Rattata, 21=Spearow, 41=Zubat, 96=Drowzee

Need to test it a little more, but so far it seems to work quite well.

Exi89 avatar Jul 31 '16 00:07 Exi89

Excellent! I'm building a proper integration with PokemonGo-Maps now using their recently released Webhooks instead of modifying their code, and I'll use this as a template for that feature.

Brideau avatar Jul 31 '16 01:07 Brideau

@Brideau im not really sure how to do this in node but i think something like this should do it? in config.js config.EXCLUDE = [10,13,16,19,21,41]

in app.js if (config.EXCLUDE.indexOf(m.pokemon_id) != -1) { … } and move the insert stuff in that if

cytec avatar Aug 13 '16 01:08 cytec