Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

FYI: Places.js API Cities Polyfill #1163

Open
theprojectsomething opened this issue Jan 23, 2022 · 2 comments
Open

FYI: Places.js API Cities Polyfill #1163

theprojectsomething opened this issue Jan 23, 2022 · 2 comments

Comments

@theprojectsomething
Copy link

I've been putting together a small library to polyfill type: city searches. It's intended as a drop-in fix post API shutdown, bypassing any refactor or provider-switch nightmare scenarios.

polyfill demo: https://theprojectsomething.github.io/re.places/#algolia
repo: https://github.com/theprojectsomething/re.places

If anyone is currently using the cities functionality and would be open to giving the polyfill a spin I'd be very happy for the feedback.

Similarly Algolia people, if you had any suggestions / feedback they'd be appreciated. Particularly if I've overstepped the line with anything in the repo.

Install is as simple as:

import 'https://cdn.jsdelivr.net/npm/places.js@1.19.0'
// activate polyfill - script must be served locally and imported directly after places.js
import '/re.places.algolia.js'

Background: We've been using places for a few years now @CitizensGBR to allow users to indicate where in the world they are from (simple city geocode, we don't need an address). I got the email earlier in January reminding about the API sunset and figured there might be a simple solution for a simple use case.

@JonathanMontane
Copy link
Contributor

@theprojectsomething Thank you for building this, I played around with it a bit and it seems to work quite nicely for popular cities. Happy to see people trying to build alternatives to Algolia Places.

@theprojectsomething
Copy link
Author

Thanks @JonathanMontane .. yes the cities are based on a refined db (you can browse it on kaggle or build it in the repo) but you could easily augment / substitute this. If you have any further questions, comments or suggestions feel free to open an issue in the repo. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants