Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backend firebase function and fix search page parsing #4

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ericboucher
Copy link

@ericboucher ericboucher commented Dec 18, 2023

This PR fixes #3 #1

  • adds a simple Firebase function wrapping the Google Places API.
  • fixes the doctolib.fr parsing on search pages, the data is now loaded in the DOM in two steps so we add a mutation observer.
  • adds a link to Google Maps when a rating is available

I did not try to piggyback on the Google Maps API initialized by the map view. The map is not on by default anymore and it looks like they added a few restrictions. I did not try much to be honest so there might be a way to hack it.

Note: it's not ideal to set up a wrapper around Google. To mitigate potential costs we could set up a simple caching mechanism. There are about 200k doctors in France and the Google API is around $17 for 100,000 calls.

Screenshot 2023-12-18 at 8 47 19 PM

Copy link
Owner

@JackNUMBER JackNUMBER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thank you for your proposal.
I'm not comfortable in using Firebase in this project, the JS API should do the job.

In the same way, TS is a really good tool but here it is not helping.

let name = element.querySelectorAll('.dl-search-result-name')[0].textContent;
const name = element.querySelector('[data-test="dl-search-result-name"]').textContent;

const addressDiv = element.querySelector('.ml-96');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not durable (depending of UI kit)

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

Successfully merging this pull request may close these issues.

Extension is down
2 participants