From 52f2ad990e7ba754fde4dc94c7b64b042a17bec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A8r=20Kessels?= Date: Wed, 21 Aug 2019 12:02:52 +0200 Subject: [PATCH] Conceptual addition for Dingemans comic. I could not get the bot running locally. Instructions unclear, or just me being stupid. So I coded this addition **without testing**. It probably won't run right away. Also unclear is how/if strptime can handle "Dutch" strings like "24 augustus 2019". I kindof assumed it can, based on the set locales. --- stripbot/comics.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stripbot/comics.py b/stripbot/comics.py index 37addc5..688284e 100644 --- a/stripbot/comics.py +++ b/stripbot/comics.py @@ -31,6 +31,21 @@ def extract_comic(self): self.id = self.element.get('data-pid') +class Dingemans(BaseComicModel): + base_url = "https://www.trouw.nl/cartoons/de-wereld-van-anton-dingeman~b21b94dc/" + name = "Anton Dingeman" + author = "Pieter Geenen" + + css_selector = 'article.artstyle section' + + def extract_comic(self): + self.page_url = self.base_url + date = self.element.cssselect('h3.title') + self.id = date + self.date = datetime.datetime.strptime(date, "%d %B %Y") # 21 augustus 2019 + self.image_url = self.element.cssselect('figure img')[0].get('href') + + class Jeroom(BaseComicModel): base_url = "http://www.humo.be/jeroom/" name = "Jeroom"