pokeminer
pokeminer copied to clipboard
Added Pokestops
Following the logic for Gyms, now scans for pokestops and reports lured pokemon.
Is there any way to apply your PR from windows using TortoiseGit?
I'm not very skilled in git... so i don't know enough to say one way or another, but i would imagine so? I might be able to do a push request to your fork if you'd like...
I got it working using a .patch file, but thank you for your offering :) Now that I am studying the code, it does not detects when a Pokestop is lured to show it as lured in the map, right ?
I think that should be fixed now. It is currently updating lure info with the pokemon as long as a worker can see it.
I appreciate the PR, thanks. But most probably I won't be merging it, as I see no purpose in gathering data about pokestops. I felt the same way about gyms until someone convinced me that it may be purposeful to do it and analyze/display Gyms data over time. There are a lot of variables there: ownership, guarding Pokemon, prestige... which means you can do lot of things with the data. But pokestops? You can only check whether they have lure module and what spawned there, and that seems boring.
I'll leave the PR open in case anyone wants to use it.
I would really love to see lured pokestops on the map, makes it a lot easier when you plan your trip to walk around town.
I'm planning to analyze the lure hot spots around my area... We have two distinct zones that are always lured and they seem to have a theme of pokemon, and lately have been dropping rare stuff at certain hours. I will continue to update the PR for others.
Thanks alot, I would love to help, but I'm only a network admin and have literally no idea of python :) I'm just glad I can run a community site for a lot of users here because of you guys.
I'm also planning to analyze the lured pokestops, in my town there aren't many pokestops, and usually there is like 1 or 2 pokestops lured, with the gathered data I could easily know which is the most lured one
Hi I was trying to check out your pull request locally, I got a conflict in db.py where i removed the old def get_forts(session) But when I run web.py and connect to the site I get a lot of exceptions, ending with:
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1582, "Incorrect parameter count in the call to native function 'datediff'") [SQL: "\n SELECT\n ss.stop_id,\n ss.id,\n ss.lure_expires_timestamp_ms,\n ss.encounter_id,\n ss.active_pokemon_id,\n ss.last_modified,\n s.lat,\n s.lon\n FROM stop_sightings ss\n\t\t\tinner join (SELECT max(id) as maxid, stop_id, max(lure_expires_timestamp_ms) as ltime, max(sighting_time) stime from stop_sightings\n\t\t\twhere dateadd(mi, datediff(mi, getutcdate(), getDate()), dateadd(S, lure_expires_timestamp_ms, '1970-01-01')) > getdate() or lure_expires_timestamp_ms = 0\ngroup by stop_id) mss on ss.id = mss.maxid\n JOIN stops s ON s.id=ss.stop_id\n ORDER BY ss.last_modified DESC\n "]
I'm using mysql and it works with normal with the master branch.
You need to recreate your sqlfile
import db db.Base.metadata.create_all(db.get_engine())
I tried, I even dropped the whole database and created new tables with import db, but still the same error :(
http://pastebin.com/EihXT5VZ
looks like datediff is different between mssql and mysql... mssql takes 3 parameters where as the mysql function takes 2... you'll have to modify the code for mysql...
Well thanks, but I guess I have to live without pokestops then I dont want to install a windows machine for that. Unless you take donations for implementing mysql :)
SELECT ss.stop_id, ss.id, ss.lure_expires_timestamp_ms, ss.encounter_id, ss.active_pokemon_id, ss.last_modified, s.lat, s.lon FROM stop_sightings ss inner join (SELECT max(id) as maxid, stop_id, max(lure_expires_timestamp_ms) as ltime, max(sighting_time) stime from stop_sightings where lure_expires_timestamp_ms > CURRENT_TIMESTAMP or lure_expires_timestamp_ms = 0 group by stop_id) mss on ss.id = mss.maxid JOIN stops s ON s.id=ss.stop_id ORDER BY ss.last_modified DESC
I think will work, i don't have mysql to test but the funcitonality should be good
This replaces the query in db.py get_stops
For MySQL you have to use UNIX_TIMESTAMP() instead of CURRENT_TIMESTAMP because the latter gives you a formated string and the query never returns lured stops
@skarlath this is only showing the stop as lured for the short period of time when such lure spawned a pokemon and a worker was near it, so it only appears lured for 1-2mins. Is this the intended behavior or am i missing something?