Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linsen, you have arrived #126

Merged
merged 12 commits into from
Jun 4, 2024
Merged

Linsen, you have arrived #126

merged 12 commits into from
Jun 4, 2024

Conversation

The1Penguin
Copy link
Contributor

@The1Penguin The1Penguin commented May 30, 2024

We have gathered here today, to talk about Linsen.
It works, @Titanothere mentioned that he preferred to instead of having Meat, Fish, and Veg it should have the main part of the dish, as the api is funky.

@The1Penguin The1Penguin self-assigned this May 30, 2024
@The1Penguin
Copy link
Contributor Author

The1Penguin commented May 30, 2024

I would recommend waiting a week to check that it works with a different menu, since I have tried to retrofit it to what we do.

@The1Penguin
Copy link
Contributor Author

The1Penguin commented May 30, 2024

Would solve #97

Copy link
Contributor

@Rembane Rembane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some solid code very much in line with the rest of the codebase. There are some comments that you can handle if you want to, otherwise I think it's a great idea to merge this and get it out in the reality ASAP to see where it fails.

One thing you might want to do is to save downloaded raw json blobs so you have something to feed to your parser whenever things go haywire. It's very much future work though. :)

@@ -48,6 +49,25 @@ main = hspec $ do
)
)

describe "Cafe Linsen" $ it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests <3

test/linsen.json Outdated
@@ -0,0 +1 @@
{"docs":[{"id":"6622a60540a21ce1eea7aa6e","title":"Tårtor","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Frukttårta 8, 12 & 18 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Princesstårta 8, 12 & 18 bitar","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":" Gräddfrukttårta 8, 12 & 18 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"White lady 8, 12 & 18 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Schwarzwald 8 & 12 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Chokladtårta 8 & 12 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Moccatårta 8 & 12 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Passionsmousse 8 & 12 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Chokladtryffeltårta 8 bitar","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"Jordgubbsmoussetårta 12 bitar","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"Italiensk hallonmaräng 12 bitar","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"Cheesecake moussetårta 12 bitar 47:-/bit","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Cheesecake moussetårta 6 bitar","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":" Italiensk hallonmaräng 6 bitar ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Prinstårta (gluten, laktos, nöt och mandelfri) 10 bitar 49:-/bit","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Trippelchoklad moussetårta 6 bitar Jordgubbsmoussetårta 6 bitar 52:-/bit","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"cake-menu","createdAt":"2024-04-19T17:12:37.508Z","updatedAt":"2024-04-20T10:07:40.733Z","richText_html":"<p><em><strong>Frukttårta 8, 12 & 18 bitar </strong></em></p><p><em><strong>Princesstårta 8, 12 & 18 bitar</strong></em></p><p><em><strong> Gräddfrukttårta 8, 12 & 18 bitar </strong></em></p><p><em><strong>White lady 8, 12 & 18 bitar </strong></em></p><p><em><strong>Schwarzwald 8 & 12 bitar </strong></em></p><p><em><strong>Chokladtårta 8 & 12 bitar </strong></em></p><p><em><strong>Moccatårta 8 & 12 bitar </strong></em></p><p><em><strong>Passionsmousse 8 & 12 bitar </strong></em></p><p><em><strong>Chokladtryffeltårta 8 bitar</strong></em></p><p> <em><strong>Jordgubbsmoussetårta 12 bitar</strong></em></p><p> <em><strong>Italiensk hallonmaräng 12 bitar</strong></em> <em><strong>Cheesecake moussetårta 12 bitar 47:-/bit</strong></em></p><p><em><strong>Cheesecake moussetårta 6 bitar</strong></em></p><p><em><strong> Italiensk hallonmaräng 6 bitar </strong></em></p><p><em><strong>Prinstårta (gluten, laktos, nöt och mandelfri) 10 bitar 49:-/bit</strong></em></p><p><em><strong>Trippelchoklad moussetårta 6 bitar Jordgubbsmoussetårta 6 bitar 52:-/bit</strong></em></p>"},{"id":"6622a51440a21ce1eea7a998","title":"Fredag","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Meny. V 22","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"31-05-2024","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"type":"linebreak","version":1},{"detail":0,"format":1,"mode":"normal","style":"","text":"Natt Överbakad Högrev. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Rotfrukter/ Timjansky/ Persilja/ Pommes Chateau.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Night Overbaked Hörev. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Root vegetables/ Thyme/ Parsley/ Pommes Chateau.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Stekt Fisk.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Remouladsås/ Citron/ Dill/ Picklade Morötter/ Rostad Potatis.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Fried fish.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Remoulade sauce/ Lemon/ Dill/ Pickled carrots/ Roasted potatoes.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Chana Masala.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Kikärtor/ Grönsaker/ Potatis Pakora/ Nannbröd/ Ris ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Chana Masala. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Chickpeas/ Vegetables/ Potato Pakora/ Naan Bread/ Rice","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Caesarsallad med kyckling och bacon/räkor","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":2,"mode":"normal","style":"","text":"Caesar salad with chicken and bacon/shrimp","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Wokade nudlar med kyckling/tofu","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" Stir-fried noodles with chicken/tofu","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"95:-/90:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"En tallrik med sallad","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" A plate of salad","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"70:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"friday-menu","createdAt":"2024-04-19T17:08:36.895Z","updatedAt":"2024-05-28T13:54:45.355Z","richText_html":"<p>Meny. V 22</p><p>31-05-2024</p><p><br><strong>Natt Överbakad Högrev. </strong></p><p>Rotfrukter/ Timjansky/ Persilja/ Pommes Chateau.</p><p><strong>Night Overbaked Hörev. </strong></p><p>Root vegetables/ Thyme/ Parsley/ Pommes Chateau.</p><p><strong>Stekt Fisk.</strong></p><p>Remouladsås/ Citron/ Dill/ Picklade Morötter/ Rostad Potatis.</p><p><strong>Fried fish.</strong></p><p>Remoulade sauce/ Lemon/ Dill/ Pickled carrots/ Roasted potatoes.</p><p><strong>Chana Masala.</strong></p><p>Kikärtor/ Grönsaker/ Potatis Pakora/ Nannbröd/ Ris </p><p><strong>Chana Masala. </strong></p><p>Chickpeas/ Vegetables/ Potato Pakora/ Naan Bread/ Rice</p><p><em><strong>115:-/105:-</strong></em></p><p><em><strong>Caesarsallad med kyckling och bacon/räkor</strong></em><em> </em> </p><p><em>Caesar salad with chicken and bacon/shrimp</em> <em><strong>115:-/105:-</strong></em></p><p><em><strong>Wokade nudlar med kyckling/tofu</strong></em><em> Stir-fried noodles with chicken/tofu</em> <em><strong>95:-/90:-</strong></em></p><p><em><strong>En tallrik med sallad</strong></em><em> A plate of salad</em> <em><strong>70:-</strong></em></p><p></p><p></p>"},{"id":"6622a50540a21ce1eea7a966","title":"Torsdag","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Meny. V22","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"30-05-2024","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Högrevsburgare.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lökringar/ Inlagd Gurka/ Rostad Lök/ Feferoni Kräm/ Pommes.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Beef burger.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Onion Rings/ Pickled Cucumber/ Roasted Onion/ Pepperoni Cream/ French Fries.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Italiensk Fisksoppa.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Räkor/ Tomater/ Vit vin/ Timjan/ Vitlökskrutonger.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Italian Fish Soup.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Prawns/ Tomatoes/ White wine/ Thyme/ Garlic croutons.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Tofu Burgare.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lökringar/ Inlagd Gurka/ Rostad Lök/ Feferoni Kräm/ Pommes.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Tofu Burger.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Onion Rings/ Pickled Cucumber/ Roasted Onion/ Pepperoni Cream/ French Fries.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Caesarsallad med kyckling och bacon/räkor","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":2,"mode":"normal","style":"","text":"Caesar salad with chicken and bacon/shrimp","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Wokade nudlar med kyckling/tofu","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" Stir-fried noodles with chicken/tofu","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"95:-/90:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"En tallrik med sallad","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" A plate of salad","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"70:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"thursday-menu","createdAt":"2024-04-19T17:08:21.777Z","updatedAt":"2024-05-24T13:15:59.352Z","richText_html":"<p>Meny. V22</p><p>30-05-2024</p><p><strong>Högrevsburgare.</strong></p><p>Lökringar/ Inlagd Gurka/ Rostad Lök/ Feferoni Kräm/ Pommes.</p><p><strong>Beef burger.</strong></p><p>Onion Rings/ Pickled Cucumber/ Roasted Onion/ Pepperoni Cream/ French Fries.</p><p><strong>Italiensk Fisksoppa.</strong></p><p>Räkor/ Tomater/ Vit vin/ Timjan/ Vitlökskrutonger.</p><p><strong>Italian Fish Soup.</strong></p><p>Prawns/ Tomatoes/ White wine/ Thyme/ Garlic croutons.</p><p><strong>Tofu Burgare.</strong></p><p>Lökringar/ Inlagd Gurka/ Rostad Lök/ Feferoni Kräm/ Pommes.</p><p><strong>Tofu Burger.</strong></p><p>Onion Rings/ Pickled Cucumber/ Roasted Onion/ Pepperoni Cream/ French Fries.</p><p><em><strong>115:-/105:-</strong></em></p><p><em><strong>Caesarsallad med kyckling och bacon/räkor</strong></em><em> </em> </p><p><em>Caesar salad with chicken and bacon/shrimp</em> <em><strong>115:-/105:-</strong></em></p><p><em><strong>Wokade nudlar med kyckling/tofu</strong></em><em> Stir-fried noodles with chicken/tofu</em> <em><strong>95:-/90:-</strong></em></p><p><em><strong>En tallrik med sallad</strong></em><em> A plate of salad</em> <em><strong>70:-</strong></em></p><p></p>"},{"id":"6622a4f140a21ce1eea7a92d","title":"Onsdag","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":" V.22","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"29-05-2024","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Kalops.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Rödbetor/ Saltgurka/ Persilja/ Kokt Potatis.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Swedish Beef Stew.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Beetroot/ Pickled cucumber/ Parsley/ Boiled potatoes.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Paella.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Fisk/ Räkor/ Musslor/ Gröna Ärtor/ Saffran. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Paella.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Fish/ Prawns/ Mussels/ Green Peas/ Saffron.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Bönbiffar.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Currysås/ Broccoli/ Vårlök/ Ris.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Bean patties.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Curry sauce/ Broccoli/ Spring onions/ Rice.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Caesarsallad med kyckling och bacon/räkor","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"Caesar salad with chicken and bacon/shrimp","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Wokade nudlar med kyckling/tofu","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" Stir-fried noodles with chicken/tofu","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"95:-/90:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"En tallrik med sallad","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" A plate of salad","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"70:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"wednesday-menu","createdAt":"2024-04-19T17:08:01.045Z","updatedAt":"2024-05-24T13:09:36.997Z","richText_html":"<p> V.22</p><p>29-05-2024</p><p><strong>Kalops.</strong></p><p>Rödbetor/ Saltgurka/ Persilja/ Kokt Potatis.</p><p><strong>Swedish Beef Stew.</strong></p><p>Beetroot/ Pickled cucumber/ Parsley/ Boiled potatoes.</p><p><strong>Paella.</strong></p><p>Fisk/ Räkor/ Musslor/ Gröna Ärtor/ Saffran. </p><p><strong>Paella.</strong></p><p>Fish/ Prawns/ Mussels/ Green Peas/ Saffron.</p><p><strong>Bönbiffar.</strong></p><p>Currysås/ Broccoli/ Vårlök/ Ris.</p><p><strong>Bean patties.</strong></p><p>Curry sauce/ Broccoli/ Spring onions/ Rice.</p><p><em><strong>115:-/105:-</strong></em></p><p></p><p><em><strong>Caesarsallad med kyckling och bacon/räkor</strong></em><em> </em> <em>Caesar salad with chicken and bacon/shrimp</em> <em><strong>115:-/105:-</strong></em></p><p><em><strong>Wokade nudlar med kyckling/tofu</strong></em><em> Stir-fried noodles with chicken/tofu</em> <em><strong>95:-/90:-</strong></em></p><p><em><strong>En tallrik med sallad</strong></em><em> A plate of salad</em> <em><strong>70:-</strong></em></p>"},{"id":"6622a4dd40a21ce1eea7a8fa","title":"Tisdag","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Meny V. 22","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"28-05-2024 ","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Raggmunk & Stekt Fläsk.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lingon/ Persilja.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Raggmunk & Fried Pork.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Lingonberry/ Parsley.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Pocherad Dagens Fångst.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Bryntsmör/ Friterade Kapris/ Kpris/ Rödbetor/ Blomkålpure.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Poached Catch of the Day. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Clarified butter/ Fried capers/ Capers/ Beetroot/ Cauliflower puree.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Pasta Arrabiata.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Het Tomatsås/ Sojafärs/ Svamp/ Kantareller/ Grana Padano/ Basilika.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Pasta Arrabiata.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Hot Tomato Sauce/ Minced Soy/ Mushrooms/ Chanterelles/ Grana Padano/ Basil.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Caesarsallad med kyckling och bacon/räkor","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"Caesar salad with chicken and bacon/shrimp","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Wokade nudlar med kyckling/tofu","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" Stir-fried noodles with chicken/tofu ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"95:-/90:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"En tallrik med sallad","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" A plate of salad","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"70:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"tuesday-menu","createdAt":"2024-04-19T17:07:41.594Z","updatedAt":"2024-05-27T14:33:59.712Z","richText_html":"<p>Meny V. 22</p><p>28-05-2024 </p><p><strong>Raggmunk & Stekt Fläsk.</strong></p><p>Lingon/ Persilja.</p><p><strong>Raggmunk & Fried Pork.</strong></p><p>Lingonberry/ Parsley.</p><p><strong>Pocherad Dagens Fångst.</strong></p><p>Bryntsmör/ Friterade Kapris/ Kpris/ Rödbetor/ Blomkålpure.</p><p><strong>Poached Catch of the Day. </strong></p><p>Clarified butter/ Fried capers/ Capers/ Beetroot/ Cauliflower puree.</p><p><strong>Pasta Arrabiata.</strong></p><p>Het Tomatsås/ Sojafärs/ Svamp/ Kantareller/ Grana Padano/ Basilika.</p><p><strong>Pasta Arrabiata.</strong></p><p>Hot Tomato Sauce/ Minced Soy/ Mushrooms/ Chanterelles/ Grana Padano/ Basil.</p><p><em><strong>115:-/105:-</strong></em></p><p></p><p><em><strong>Caesarsallad med kyckling och bacon/räkor</strong></em> <em>Caesar salad with chicken and bacon/shrimp</em> <em><strong>115:-/105:-</strong></em></p><p><em><strong>Wokade nudlar med kyckling/tofu</strong></em><em> Stir-fried noodles with chicken/tofu </em><em><strong>95:-/90:-</strong></em></p><p><em><strong>En tallrik med sallad</strong></em><em> A plate of salad</em> <em><strong>70:-</strong></em></p>"},{"id":"6622a4b440a21ce1eea7a8c4","title":"Monday","richText":{"root":{"type":"root","format":"","indent":0,"version":1,"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Meny V.22","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"27-05-2024","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Kalv Wallenbergare.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Gröna Ärtor/ Skirat Smör/ Lingon/ Potatis Pure.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Calf Wallenberger.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Green Peas/ Clarified Butter/ Lingonberry/ Potato Puree.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Halstrad Dagens Fångst.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Dillmajo/ Pakchoi/ Ärtskott/ Lökstekta Potatis.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Grilled Catch of the Day.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Dill Mayo/ Pakchoi/ Pea Shoots/ Onion Fried Potatoes.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Baingan Masala.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Aubergine/ Paprika/ Svamp/ Raita/ Naanbröd/ Ris.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":1,"mode":"normal","style":"","text":"Baingan Masala. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Eggplant/ Paprika/ Mushroom/ Raita/ Naan bread/ Rice.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Caesarsallad med kyckling och bacon/räkor","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"Caesar salad with chicken and bacon/shrimp","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"115:-/105:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"Wokade nudlar med kyckling/tofu","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" Stir-fried noodles with chicken/tofu ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"95:-/90:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":3,"mode":"normal","style":"","text":"En tallrik med sallad","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":" A plate of salad","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"text","version":1},{"detail":0,"format":3,"mode":"normal","style":"","text":"70:-","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr"}},"slug":"monday-menu","createdAt":"2024-04-19T17:07:00.008Z","updatedAt":"2024-05-27T08:49:31.008Z","richText_html":"<p>Meny V.22</p><p>27-05-2024</p><p><strong>Kalv Wallenbergare.</strong></p><p>Gröna Ärtor/ Skirat Smör/ Lingon/ Potatis Pure.</p><p><strong>Calf Wallenberger.</strong></p><p>Green Peas/ Clarified Butter/ Lingonberry/ Potato Puree.</p><p><strong>Halstrad Dagens Fångst.</strong></p><p>Dillmajo/ Pakchoi/ Ärtskott/ Lökstekta Potatis.</p><p><strong>Grilled Catch of the Day.</strong></p><p>Dill Mayo/ Pakchoi/ Pea Shoots/ Onion Fried Potatoes.</p><p><strong>Baingan Masala.</strong></p><p>Aubergine/ Paprika/ Svamp/ Raita/ Naanbröd/ Ris.</p><p><strong>Baingan Masala. </strong></p><p>Eggplant/ Paprika/ Mushroom/ Raita/ Naan bread/ Rice.</p><p><em><strong>115:-/105:-</strong></em></p><p></p><p><em><strong>Caesarsallad med kyckling och bacon/räkor</strong></em> <em>Caesar salad with chicken and bacon/shrimp</em> <em><strong>115:-/105:-</strong></em></p><p><em><strong>Wokade nudlar med kyckling/tofu</strong></em><em> Stir-fried noodles with chicken/tofu </em><em><strong>95:-/90:-</strong></em></p><p><em><strong>En tallrik med sallad</strong></em><em> A plate of salad</em> <em><strong>70:-</strong></em></p>"}],"totalDocs":6,"limit":10,"totalPages":1,"page":1,"pagingCounter":1,"hasPrevPage":false,"hasNextPage":false,"prevPage":null,"nextPage":null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is horrible! :O

That you got something well structured out of it impresses me.

NoReqBody
jsonResponse
mempty
<&> responseBody
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<&> <- pretty!

(parseEither
( withObject "Parse meals"
$ (.: "docs")
>=> (pure . (!! (6 - (\(_,_,a) -> a) (toWeekDate day))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indices and arithmetic makes parsing so much better. Do we get the whole week in the json blob and then pick the correct day by index?

There's a way to get the third element from something by using the lens _3, but it's very much a case of... if you love lenses you can give it a go. 😸

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole week is in the blob.

I changed a bit of the code here, but haven't figured out how to index into the list with lenses without also introducing Maybe. Maybe clearly handling that case would be better for this code

Comment on lines 77 to 80
(2 ,vs) -> [vs]
(6 ,vs) -> [vs]
(10,vs) -> [vs]
_ -> []) <=< ap (zipWithM sumFood) tail
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need more context to understand this code. What do 2, 6 and 10 mean?

Otherwise this code feels very much in line with the spirit of this code base. Good job!

Comment on lines 90 to 91
vs -> last vs .: "text"
<&> strip . replace "/ " ", "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: This code is quite an experience to read since it goes both left to right and right to left. If you pick one direction it becomes less eye-jumpy. Something like: strip . replace "/ " ", " <$> last vs .: "test" perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, changed that in the last commit added

Copy link

@malmz malmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool code, I want to vomit

@The1Penguin
Copy link
Contributor Author

Pushed a change so that when the api has fewer than a certain amount of dishes, there is no food, based on the current menu

@The1Penguin The1Penguin requested a review from Rembane June 3, 2024 13:09
@The1Penguin
Copy link
Contributor Author

It should work as expected now

@The1Penguin The1Penguin merged commit 1a56185 into main Jun 4, 2024
1 check passed
@The1Penguin The1Penguin deleted the linsen-menu branch June 4, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants