limdingwen / parliament-summary

A simple and modern public oversight website for the Singapore's democracy.
https://democracyat.work/
Creative Commons Zero v1.0 Universal
4 stars 0 forks source link

Postal code to GRC/MP checker #12

Open limdingwen opened 1 month ago

limdingwen commented 1 month ago

Following in the footsteps of https://www.theyworkforyou.com/, could help with the personalised annotated debates as well.

clemneo commented 1 month ago

The functionality exists here: https://www.parliament.gov.sg/mps/find-mps-in-my-constituency

One way to reproduce this would be to:

  1. Use a postal code -> coordinate API (probably not free) or dataset (like (here)[https://www.kaggle.com/datasets/billptw/singapore-postal-code-to-latlon])

  2. Use the data.gov.sg electoral boundaries data from here to convert coordinate -> constituency

  3. Manually curate a constituency + MPs dataset, and use that?

Is there any way more straightforward than this?

limdingwen commented 1 month ago

A more straightforward way would be to query https://www.parliament.gov.sg/mps/find-mps-in-my-constituency directly (POST, then set SearchKeyword to the postal code), with caching + validation to lessen the load on the original server, but I'm not sure if that breaks the TOS.

At the end of the day this feature probably isn't very important since as you mentioned the functionality already exists, but I think what we could provide is a more modern UI, as well as changing up the annotated debates a bit, like a "This debate mentions your MP!" sort of thing.