A simple crawler in Node.js to build an API to get the current emergency pharmacies for a given location in Germany directly from BLAK. I needed that quickly for a small project.
This repository contains code for a web crawler that scrapes a website. The API can be pubslished using a serverless lambda functions at hosters like Netlify.
Comes with absolutely no warranty, API is subject to change and it needs refactoring / sanity measures. Use on your own risk.
Clone the repository
Install dependencies: npm install
This project was built with the following tools:
- Node: A JavaScript runtime built on Chrome's V8 JavaScript engine.
- Axios: A promised based HTTP client for the browser and Node.js.
- Cheerio: A lightweight implementation of jQuery which provided access to the DOM on the server.
I deployed the API using Netlify's serverless functions:
-
https://apotheken-notdienst-api.netlify.app/.netlify/functions/server
-
Query Parameters:
lat
| Latitudelon
| Longitudedate
| UNIX Timestamp
-
Example for Munich on 05.05.2020: https://apotheken-notdienst-api.netlify.app/.netlify/functions/server?lat=48.135124&lon=11.581981&date=1588702203721
This project is licensed under the MIT license.