Enable WBS and look everywhere

This commit is contained in:
Akshay Mankar 2024-02-18 12:34:40 +01:00
parent 8ef9b1c24e
commit 58a53fa76b
Signed by: axeman
GPG key ID: CA08F3AB62369B89

View file

@ -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 = "<a href=\"https://inberlinwohnen.de" <> offer.link <> "\" >Apply Here</a>"
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))