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