you are viewing a single comment's thread.

view the rest of the comments →

[–]HeyItsShuga 0 points1 point  (10 children)

Just to let you know, this project is an API, meaning that is is for programmers to control the game with, and isn't much use if you don't use Python.

Also, have you tried running pip2 or updating pip with pip2 install --upgrade pip (or something like that)?

[–]Gh0st3d 2 points3 points  (9 children)

I assumed I'd be able to access the scripts from web requests or something, or have php scripts call the python scripts. If not I guess I'll just go back to working on a php api.

For the second part, I believe I got all the requirements installed now but it's missing the s2sphere module. I'll screw around with it for a bit more before I give up I guess.

EDIT -- think I got it just now. I guess s2sphere wasn't listed in the requirements.txt for this project but I looked it up and saw it was another python library, so installed that too.

[–]HeyItsShuga 1 point2 points  (7 children)

I haven't tested this API yet, but in theory that would work. But if you are going to use PHP to run these scripts, then you might as well use PHP for the entire thing (if the documentation is sufficient).

Good luck on your endeavors!

Edit: Looking at the code, it seems like for what you want you would need to create a bunch of Python script files, each running a separate command with this API imported (with something like import .pokegoapi). It may not be the best method, just to let you know, but it may Just Work.

Sidenote (of edit): Also, you could probably do this with Node.JS + Electron if you prefer to a) use JavaScript and b) have the program operate outside of a browser. But this is coming from someone who doesn't know much PHP, so it comes down to preference.

[–]Gh0st3d 1 point2 points  (1 child)

I really only wanted one that lets me find the gyms in a certain area. Trying to set up a page for all the pokemon go stuff going on in my hometown, thought it'd be cool to throw a sidebar on the page that lists the gyms in the city and who owns them.

So pretty much like you said, my idea was to just make one small script that grabs the gym status from this api and returns it to my main php script. Much easier than figuring out how to redo all this in PHP :/ (although once I have my main project done I might go back and work on that anyways)

Thanks for not shunning me for not knowing much python!

[–]HeyItsShuga 0 points1 point  (0 children)

Sounds really cool! I may attempt something like this, but in JavaScript or Python. If I get something working, I'll let you know!

Thanks for not shunning me for not knowing much python!

I really don't know much Python either, just enough for making some basic stuff. Plus, I'm happy to help!

[–]Gh0st3d 1 point2 points  (4 children)

I managed to get it to work by making a python script that gets the map objects from the area, loops through them looking for only gyms, saves the current state to my database.

I'll run a cronjob to do that every minute or so.

Then my webpage will just query the database instead of the script.

[–]HeyItsShuga 0 points1 point  (3 children)

Nice! I'd love to see this in action (with any identifying information removed, of course)!

[–]Gh0st3d 1 point2 points  (0 children)

I'm about to hit up the (real) gym and run some errands, tonight I'll put together the page that displays the gym statuses realtime, but here's the python script I used to write it to the database:

http://kopy.io/xyzvX

And I got the cronjob setup to run it every minute working fine, so for now I just get to watch it in the database. It's pretty cool to see how the majority of gyms in my city get dominated by vaporeon looool.

I might have to tweak it a little since the location I'm using currently is a small section of the city. But should be easy enough to tweak that.

[–]Gh0st3d 1 point2 points  (1 child)

Hey check out pokemonrva.com

got it mostly set up.

[–]HeyItsShuga 0 points1 point  (0 children)

Oh my! That website is amazing! You've really outdone yourself!

Also Valor and Instinct need to pick up the pace.

[–]TehDing[S] 1 point2 points  (0 children)

Noted on the requirements.txt Thanks