neopostmodern / wohnungsbot

Der Wohnungsbot — die Anwendung zum 2. Akt ("Das Versprechen des Bots") des Automatisierungsdramas in drei Akten "Von einem der auszog eine Wohnung in Berlin zu finden" von Clemens Schöll
https://wohnungsbot.de
GNU Affero General Public License v3.0
150 stars 27 forks source link

Don't apply to flats that are already applied #108

Closed drblaui closed 2 years ago

drblaui commented 2 years ago

I confess, this isn't solving #89 completely, but I'd say it helps with 98% of the real world cases. Also it extends the problem space a bit more, because if you use multiple computers (like me - one for testing, one for running) the bot(s) try to apply for one flat twice

Whether the bot or a user applies for a flat, it gets added to the "Merkzettel" automatically. Elements in that list get visually highlighted by a red heart next to the title. So if you check for a flat if that element has the shortlist-star--shortlisted class, the flat is on the Merkzettel.

Obviously users could remove those flats from the list by hand, but I see no real reason why they would do that ALSO users could add flats they haven't already applied for, but with the current state of the market, they wouldn't get the flat anyway

Important notice: I had to rewrite one forEach loop into a normal for loop, because forEach sadly isn't async aware

neopostmodern commented 2 years ago

Whoa, nice catch! I will only have time to review this next week, but looks promising – thanks a lot already.

neopostmodern commented 2 years ago

Code changes are great – but could you please run prettier on the files you changed? Then I'll gladly merge it!

drblaui commented 2 years ago

I have never used prettier, but I think I did it right. Newest commit now represents prettier run on all 3 files

neopostmodern commented 2 years ago

You ran prettier successfully on the other PR but I don't see any new commits here – have you maybe forgotten to push it?

drblaui commented 2 years ago

Very much possible, should be updated now, my bad