From f9c6a9ed2e1e3d864ee179a95ac8009287b86fd7 Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Tue, 19 Sep 2023 10:30:52 +0200 Subject: [PATCH] Match API change of HYS --- .gitignore | 5 ++++- pyproject.toml | 2 +- requirements.txt | 4 ++-- src/hys_scraper/hys_scraper.py | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index be9abd3..0292df5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ +venv/ dist/ -src/hys_scraper.egg-info/ \ No newline at end of file +src/hys_scraper.egg-info/ + +project_notes.txt \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5914f50..bcf75f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "hys_scraper" -version = "0.1.32" +version = "0.1.33" description = "Scrape feedback and statistics from the European Commission's 'Have your Say' plattform." readme = "README.md" classifiers = [ diff --git a/requirements.txt b/requirements.txt index dca6682..7296db2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # # pip-compile pyproject.toml # diff --git a/src/hys_scraper/hys_scraper.py b/src/hys_scraper/hys_scraper.py index 7f80401..fe19079 100644 --- a/src/hys_scraper/hys_scraper.py +++ b/src/hys_scraper/hys_scraper.py @@ -115,7 +115,7 @@ def scrape_publication_name(self) -> str: """ url = ( self.base_url - + f"brpapi/shortTitleByPublicationId?publicationId={self.publication_id}" + + f"api/shortTitleByPublicationId?publicationId={self.publication_id}" ) r = self._get(url) @@ -148,7 +148,7 @@ def _scrape_page(self, page: int = 0, size: int = None) -> dict: dict Parsed JSON return value. """ - url = self.base_url + f"brpapi/allFeedback?publicationId={self.publication_id}" + url = self.base_url + f"api/allFeedback?publicationId={self.publication_id}" url += f"&page={page}" url += f"&size={size}" if size is not None else ""