PeWu / osm-history

OpenStreetMap history viewer
Apache License 2.0
42 stars 11 forks source link

Use osm-auth to make authenticated calls if possible #11

Closed bhousel closed 4 years ago

bhousel commented 4 years ago

Hey @PeWu !
The Mapbox team uses your osm-history tool a bunch and we are big fans! 👏

It turns out that we are such big fans, that when we use osm-history, we're starting to bump up against the OSM API's rate limit policy and get our IP address blacklisted. 😢

Since https://github.com/openstreetmap/operations/issues/36 there is a straightforward fix for this: make OSM API calls authenticated, and the rate limits will count per-user instead of per-IP.

So, this PR:

Admittedly, I am not at all familiar with AngularJS, so some of the code that I've added is probably not the best way.

For now, I've forked this project and have it saved to osmlab/osm-history, so that our team can use it.

Let me know what you think!

example:

Screenshot 2019-12-05 16 30 13
PeWu commented 4 years ago

Thanks for using this tool and thank you for your pull request! I'll try to integrate it with the AngularJS code before merging.

PeWu commented 4 years ago

@bhousel Can you allow me to commit to your fork by selecting "Allow edits from maintainers"? There should be a checkbox in the right panel of this PR. I'd like to modify this PR.

bhousel commented 4 years ago

@bhousel Can you allow me to commit to your fork by selecting "Allow edits from maintainers"? There should be a checkbox in the right panel of this PR. I'd like to modify this PR.

Weird - I do have that box checked already.. I invited you to be an admin on the fork, hope that works!

PeWu commented 4 years ago

It worked once I accepted the admin invitation. I pushed a commit to this PR to integrate the code with the AngularJS services. Can you verify that it works? I'll merge the PR once you say it is OK.

bhousel commented 4 years ago

Can you verify that it works? I'll merge the PR once you say it is OK.

Thanks @PeWu - just tested locally and it works great 👍