From 0c20f13b11342e2e4a866b61d1263c7798112fcf Mon Sep 17 00:00:00 2001 From: Kamila Date: Thu, 31 Mar 2022 17:12:47 +0200 Subject: [PATCH] robot ver 1_1 --- app/my_robot.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/my_robot.hs b/app/my_robot.hs index 142ca03..b2540f4 100644 --- a/app/my_robot.hs +++ b/app/my_robot.hs @@ -28,12 +28,12 @@ toShadowItem (url, articleTitle) = findText url = case url =~~ "[0-9]{4}.*" :: Maybe String of - Just year -> replace "%20" " " (replace ".pdf" "" year) + Just year -> replace "%C5%82" "l" (replace "%20" " " (replace ".pdf" "" year)) otherwise -> error $ "unexpected url: " ++ url getDate url = - case url =~~ "[0-9]{4}" :: Maybe String of + case url =~~ "[0-9]{4}[-.][0-9]{2}[-.][0-9]{2}|[0-9]{4}" :: Maybe String of Just year -> replace "." "-" year otherwise -> error $ "unexpected url: " ++ url