PokemonGoers / PokeData

In this project you will scrape as much data as you can get about the *actual* sightings of Pokemons. As it turns out, players all around the world started reporting sightings of Pokemons and are logging them into a central repository (i.e. a database). We want to get this data so we can train our machine learning models. You will of course need to come up with other data sources not only for sightings but also for other relevant details that can be used later on as features for our machine learning algorithm (see Project B). Additional features could be air temperature during the given timestamp of sighting, location close to water, buildings or parks. Consult with Pokemon Go expert if you have such around you and come up with as many features as possible that describe a place, time and name of a sighted Pokemon. Another feature that you will implement is a twitter listener: You will use the twitter streaming API (https://dev.twitter.com/streaming/public) to listen on a specific topic (for example, the #foundPokemon hashtag). When a new tweet with that hashtag is written, an event will be fired in your application checking the details of the tweet, e.g. location, user, time stamp. Additionally, you will try to parse formatted text from the tweets to construct a new “seen” record that consequently will be added to the database. Some of the attributes of the record will be the Pokemon's name, location and the time stamp. Additional data sources (here is one: https://pkmngowiki.com/wiki/Pok%C3%A9mon) will also need to be integrated to give us more information about Pokemons e.g. what they are, what’s their relationship, what they can transform into, which attacks they can perform etc.
Apache License 2.0
9 stars 6 forks source link

Apis for searching pokemons & sightings by multiple query parameters #131

Closed swathi-ssunder closed 8 years ago

swathi-ssunder commented 8 years ago

Validations(to check for existence, type of attribute) are still pending.

jonas-he commented 8 years ago

@swathi-ssunder how are the search parameters to be specified? Is it encoded in the URL like /api/pokemon/search?id=5&location=x,y or how does it work?

swathi-ssunder commented 8 years ago

@jonas-he - Yes, the search parameters need to be specified in the url, as query parameters. Just like the sample you mentioned above.

swathi-ssunder commented 8 years ago

Mappings implemented for few attributes, thus taking care of validation.

sacdallago commented 8 years ago

Wait, wait! &location=..? Please divide in &lat=...&lng=...

swathi-ssunder commented 8 years ago

Changes made to work now for &lat=... &lng=... as suggested.

swathi-ssunder commented 8 years ago

@sacdallago -

As per your comment https://github.com/PokemonGoers/PokeData/pull/131#issuecomment-245300110, changes have been made.

&location=..? Please divide in &lat=...&lng=...

Also, what about nested parameters such as nextEvolutions, previousEvolutions, fastAttacks, weight etc? How should the query parameters be like?

"nextEvolutions": [{
    "name": "Ivysaur",
    "_id": "57c7433c7db332a41b06d4f8",
    "pokemonId": 2
}],
"height": {
    "maximum": "0.79m",
    "minimum": "0.61m"
},
"weight": {
    "maximum": "7.76kg",
    "minimum": "6.04kg"
},
"specialAttacks": [{
    "type": "Grass",
    "name": "Power Whip",
    "damage": 70,
    "_id": "57c7433c7db332a41b06d4f5"
}]
MajorBreakfast commented 8 years ago

We, the app team, would like to implement something like this on the client side: findPokemon({ gender: 'w' }) findPokemon({ attackType: 'fire' }) findPokemon({ attackType: 'fire', minAttackDamage: 200, maxAttackDamage: 500 }) findPokemon({ gender: 'w', attackType: 'fire', minAttackDamage: 200, maxAttackDamage: 500 }) ... (other options, other combinations)

will this be supported?

Also, for locations we also need a radius around that. There's no use for exact location queries.

sacdallago commented 8 years ago

@swathi-ssunder sorry for the late reply, am currently (till monday) in Malaysia. Well you don't have to go so deep into the tree, the only call I would implement in that specific example is evolution=x where x is a pokemonId. Of your question is how to treat the calls, well, there has some preprocessing to be done (obviously it doesn't make sense to encode the whole evolution/Pokémon object in the GET call :) so, yeah, only the id and then you construct the query object :) Mongo is able to search for nested object too, no worries about that ;)

swathi-ssunder commented 8 years ago

@MajorBreakfast - Please find below the equivalent apis for the above requirements. Other use-cases should work similarly. Let me know in case of any issues.

findPokemon({ gender: 'w' }) http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/gender/w http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/search?gender=w

findPokemon({ attackType: 'fire' }) http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/search?attackType=fire

findPokemon({ attackType: 'fire', minAttackDamage: 200, maxAttackDamage: 500 }) http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/search?attackType=fire&minAttackDamage=200&maxAttackDamage=500

findPokemon({ gender: 'w', attackType: 'fire', minAttackDamage: 200, maxAttackDamage: 500 }) http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/search?gender=w&attackType=fire&minAttackDamage=200&maxAttackDamage=500