From 58a53fa76b2fd126bf2edc7002cb06a42aec7655 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Sun, 18 Feb 2024 12:34:40 +0100 Subject: [PATCH] Enable WBS and look everywhere --- berlin-scraper/app/Main.hs | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/berlin-scraper/app/Main.hs b/berlin-scraper/app/Main.hs index 82d2a3c..c98f733 100644 --- a/berlin-scraper/app/Main.hs +++ b/berlin-scraper/app/Main.hs @@ -112,21 +112,21 @@ queryIBW wreqOpts = do partText "etagen_dg" "false", partText "balkon_loggia_terrasse" "false", partText "garten" "false", - partText "wbs" "0", + partText "wbs" "all", partText "barrierefrei" "false", partText "gaeste_wc" "false", partText "aufzug" "false", partText "stellplatz" "false", partText "keller" "false", partText "badewanne" "false", - partText "dusche" "false", - partText "bez[]" "01_00", - partText "bez[]" "02_00", - partText "bez[]" "04_00", - partText "bez[]" "07_00", - partText "bez[]" "08_00", - partText "bez[]" "09_00", - partText "bez[]" "11_00" + partText "dusche" "false" + -- , partText "bez[]" "01_00", + -- partText "bez[]" "02_00", + -- partText "bez[]" "04_00", + -- partText "bez[]" "07_00", + -- partText "bez[]" "08_00", + -- partText "bez[]" "09_00", + -- partText "bez[]" "11_00" ] let link = "https://inberlinwohnen.de/wp-content/themes/ibw/skript/wohnungsfinder.php" resBS <- view responseBody <$> postWith wreqOpts link reqBody @@ -248,19 +248,13 @@ notify env offer = do offerLink = " offer.link <> "\" >Apply Here" offerBody = offerAddress <> "\n" <> offerRooms <> "\n" <> offerArea <> "\n" <> offerLink offerText = offerTitle <> "\n\n" <> offerBody - sendMsgReq1 = (defSendMessage (SomeChatId $ ChatId 952512153) offerText) {sendMessageParseMode = Just HTML} - sendMsgReq2 = (defSendMessage (SomeChatId $ ChatId 116981707) offerText) {sendMessageParseMode = Just HTML} - res1 <- runTG sendMsgReq1 + -- sendMsgReq1 = (defSendMessage (SomeChatId $ ChatId 952512153) offerText) {sendMessageParseMode = Just HTML} + -- sendMsgReq2 = (defSendMessage (SomeChatId $ ChatId 116981707) offerText) {sendMessageParseMode = Just HTML} + sendMsgReq3 = (defSendMessage (SomeChatId $ ChatId 5781922807) offerText) {sendMessageParseMode = Just HTML} + res3 <- runTG sendMsgReq3 liftIO $ - if res1.responseOk + if res3.responseOk then info env "notify" "Notified successfully" else do info env "notify" $ "Failed to notify the offer: " <> fromString (show offer) - info env "notify" $ "Response: " <> fromString (Text.unpack $ Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res1)) - res2 <- runTG sendMsgReq2 - liftIO $ - if res2.responseOk - then info env "notify" "Notified successfully" - else do - info env "notify" $ "Failed to notify the offer: " <> fromString (show offer) - info env "notify" $ "Response: " <> fromString (Text.unpack $ Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res2)) + info env "notify" $ "Response: " <> fromString (Text.unpack $ Text.decodeUtf8 (LBS.toStrict $ Aeson.encode res3))