diff --git a/examples/example-schedule.csv b/examples/example-schedule.csv index e0ca5eb..7423889 100644 --- a/examples/example-schedule.csv +++ b/examples/example-schedule.csv @@ -1,366 +1,366 @@ "day","wday","lunch","dinner" -2022-01-01,"sabato",, -2022-01-02,"domenica",, -2022-01-03,"lunedì",, -2022-01-04,"martedì",, -2022-01-05,"mercoledì",, -2022-01-06,"giovedì",, -2022-01-07,"venerdì",, -2022-01-08,"sabato",, -2022-01-09,"domenica",, -2022-01-10,"lunedì",, -2022-01-11,"martedì",, -2022-01-12,"mercoledì",, -2022-01-13,"giovedì",, -2022-01-14,"venerdì",, -2022-01-15,"sabato",, -2022-01-16,"domenica",, -2022-01-17,"lunedì",, -2022-01-18,"martedì",, -2022-01-19,"mercoledì",, -2022-01-20,"giovedì",, -2022-01-21,"venerdì",, -2022-01-22,"sabato",, -2022-01-23,"domenica",, -2022-01-24,"lunedì",, -2022-01-25,"martedì",, -2022-01-26,"mercoledì",, -2022-01-27,"giovedì",, -2022-01-28,"venerdì",, -2022-01-29,"sabato",, -2022-01-30,"domenica",, -2022-01-31,"lunedì",, -2022-02-01,"martedì",, -2022-02-02,"mercoledì",, -2022-02-03,"giovedì",, -2022-02-04,"venerdì",, -2022-02-05,"sabato",, -2022-02-06,"domenica",, -2022-02-07,"lunedì",, -2022-02-08,"martedì",, -2022-02-09,"mercoledì",, -2022-02-10,"giovedì",, -2022-02-11,"venerdì",, -2022-02-12,"sabato",, -2022-02-13,"domenica",, -2022-02-14,"lunedì",, -2022-02-15,"martedì",, -2022-02-16,"mercoledì",, -2022-02-17,"giovedì",, -2022-02-18,"venerdì",, -2022-02-19,"sabato",, -2022-02-20,"domenica",, -2022-02-21,"lunedì",, -2022-02-22,"martedì",, -2022-02-23,"mercoledì",, -2022-02-24,"giovedì",, -2022-02-25,"venerdì",, -2022-02-26,"sabato",, -2022-02-27,"domenica",, -2022-02-28,"lunedì",, -2022-03-01,"martedì",, -2022-03-02,"mercoledì",, -2022-03-03,"giovedì",, -2022-03-04,"venerdì",, -2022-03-05,"sabato",, -2022-03-06,"domenica",, -2022-03-07,"lunedì",, -2022-03-08,"martedì",, -2022-03-09,"mercoledì",, -2022-03-10,"giovedì",, -2022-03-11,"venerdì",, -2022-03-12,"sabato",, -2022-03-13,"domenica",, -2022-03-14,"lunedì",, -2022-03-15,"martedì",, -2022-03-16,"mercoledì",, -2022-03-17,"giovedì",, -2022-03-18,"venerdì",, -2022-03-19,"sabato",, -2022-03-20,"domenica",, -2022-03-21,"lunedì",, -2022-03-22,"martedì",, -2022-03-23,"mercoledì",, -2022-03-24,"giovedì",, -2022-03-25,"venerdì",, -2022-03-26,"sabato",, -2022-03-27,"domenica",, -2022-03-28,"lunedì",, -2022-03-29,"martedì",, -2022-03-30,"mercoledì",, -2022-03-31,"giovedì",, -2022-04-01,"venerdì",, -2022-04-02,"sabato",, -2022-04-03,"domenica",, -2022-04-04,"lunedì",, -2022-04-05,"martedì",, -2022-04-06,"mercoledì",, -2022-04-07,"giovedì",, -2022-04-08,"venerdì",, -2022-04-09,"sabato",, -2022-04-10,"domenica",, -2022-04-11,"lunedì",, -2022-04-12,"martedì",, -2022-04-13,"mercoledì",, -2022-04-14,"giovedì",, -2022-04-15,"venerdì",, -2022-04-16,"sabato",, -2022-04-17,"domenica",, -2022-04-18,"lunedì",, -2022-04-19,"martedì",, -2022-04-20,"mercoledì",, -2022-04-21,"giovedì",, -2022-04-22,"venerdì",, -2022-04-23,"sabato",, -2022-04-24,"domenica",, -2022-04-25,"lunedì",, -2022-04-26,"martedì",, -2022-04-27,"mercoledì",, -2022-04-28,"giovedì",, -2022-04-29,"venerdì",, -2022-04-30,"sabato",, -2022-05-01,"domenica",, -2022-05-02,"lunedì",, -2022-05-03,"martedì",, -2022-05-04,"mercoledì",, -2022-05-05,"giovedì",, -2022-05-06,"venerdì",, -2022-05-07,"sabato",, -2022-05-08,"domenica",, -2022-05-09,"lunedì",, -2022-05-10,"martedì",, -2022-05-11,"mercoledì",, -2022-05-12,"giovedì",, -2022-05-13,"venerdì",, -2022-05-14,"sabato",, -2022-05-15,"domenica",, -2022-05-16,"lunedì",, -2022-05-17,"martedì",, -2022-05-18,"mercoledì",, -2022-05-19,"giovedì",, -2022-05-20,"venerdì",, -2022-05-21,"sabato",, -2022-05-22,"domenica",, -2022-05-23,"lunedì",, -2022-05-24,"martedì",, -2022-05-25,"mercoledì",, -2022-05-26,"giovedì",, -2022-05-27,"venerdì",, -2022-05-28,"sabato",, -2022-05-29,"domenica",, -2022-05-30,"lunedì",, -2022-05-31,"martedì",, -2022-06-01,"mercoledì",, -2022-06-02,"giovedì",, -2022-06-03,"venerdì",, -2022-06-04,"sabato",, -2022-06-05,"domenica",, -2022-06-06,"lunedì",, -2022-06-07,"martedì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" -2022-06-08,"mercoledì",, -2022-06-09,"giovedì",, -2022-06-10,"venerdì",, -2022-06-11,"sabato",, -2022-06-12,"domenica",, -2022-06-13,"lunedì",, -2022-06-14,"martedì",, -2022-06-15,"mercoledì",, -2022-06-16,"giovedì",, -2022-06-17,"venerdì",,"https://ricette.giallozafferano.it/Salmorejo.html" -2022-06-18,"sabato",, -2022-06-19,"domenica",, -2022-06-20,"lunedì",, -2022-06-21,"martedì",, -2022-06-22,"mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" -2022-06-23,"giovedì",, -2022-06-24,"venerdì",, -2022-06-25,"sabato",, -2022-06-26,"domenica",, -2022-06-27,"lunedì",, -2022-06-28,"martedì",, -2022-06-29,"mercoledì",, -2022-06-30,"giovedì",, -2022-07-01,"venerdì",, -2022-07-02,"sabato",, -2022-07-03,"domenica",, -2022-07-04,"lunedì",, -2022-07-05,"martedì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" -2022-07-06,"mercoledì",, -2022-07-07,"giovedì",, -2022-07-08,"venerdì",, -2022-07-09,"sabato",, -2022-07-10,"domenica",, -2022-07-11,"lunedì",, -2022-07-12,"martedì",, -2022-07-13,"mercoledì",, -2022-07-14,"giovedì",, -2022-07-15,"venerdì",,"https://ricette.giallozafferano.it/Salmorejo.html" -2022-07-16,"sabato",, -2022-07-17,"domenica",, -2022-07-18,"lunedì",, -2022-07-19,"martedì",, -2022-07-20,"mercoledì",, -2022-07-21,"giovedì",, -2022-07-22,"venerdì",, -2022-07-23,"sabato",, -2022-07-24,"domenica",, -2022-07-25,"lunedì",, -2022-07-26,"martedì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" -2022-07-27,"mercoledì",, -2022-07-28,"giovedì",, -2022-07-29,"venerdì",, -2022-07-30,"sabato",, -2022-07-31,"domenica",, +"2022-01-01","sabato",, +"2022-01-02","domenica",, +"2022-01-03","lunedì",, +"2022-01-04","martedì",, +"2022-01-05","mercoledì",, +"2022-01-06","giovedì",, +"2022-01-07","venerdì",, +"2022-01-08","sabato",, +"2022-01-09","domenica","https://ricette.giallozafferano.it/Pollo-alla-cacciatora.html","https://ricette.giallozafferano.it/Vellutata-di-porri-con-crostini-saporiti.html" +"2022-01-10","lunedì",, +"2022-01-11","martedì",, +"2022-01-12","mercoledì",, +"2022-01-13","giovedì",, +"2022-01-14","venerdì",,"https://ricette.giallozafferano.it/Polpette-al-sugo.html" +"2022-01-15","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html","https://ricette.giallozafferano.it/Risotto-radicchio-e-pancetta.html" +"2022-01-16","domenica",, +"2022-01-17","lunedì",,"https://ricette.giallozafferano.it/Spatzle-di-spinaci.html" +"2022-01-18","martedì",, +"2022-01-19","mercoledì",, +"2022-01-20","giovedì",, +"2022-01-21","venerdì",, +"2022-01-22","sabato","https://ricette.giallozafferano.it/Gnocchi-alla-sorrentina.html", +"2022-01-23","domenica",, +"2022-01-24","lunedì",, +"2022-01-25","martedì",, +"2022-01-26","mercoledì",, +"2022-01-27","giovedì",, +"2022-01-28","venerdì",, +"2022-01-29","sabato",,"https://ricette.giallozafferano.it/Costine-al-forno.html" +"2022-01-30","domenica",, +"2022-01-31","lunedì",, +"2022-02-01","martedì",, +"2022-02-02","mercoledì",, +"2022-02-03","giovedì",, +"2022-02-04","venerdì",, +"2022-02-05","sabato",,"https://ricette.giallozafferano.it/Chili-con-carne.html" +"2022-02-06","domenica",, +"2022-02-07","lunedì",, +"2022-02-08","martedì",, +"2022-02-09","mercoledì",,"https://ricette.giallozafferano.it/Vellutata-di-porri-con-crostini-saporiti.html" +"2022-02-10","giovedì",, +"2022-02-11","venerdì",, +"2022-02-12","sabato",, +"2022-02-13","domenica",,"https://ricette.giallozafferano.it/Spatzle-di-spinaci.html" +"2022-02-14","lunedì",, +"2022-02-15","martedì",, +"2022-02-16","mercoledì",,"https://ricette.giallozafferano.it/Risotto-radicchio-e-pancetta.html" +"2022-02-17","giovedì",, +"2022-02-18","venerdì",, +"2022-02-19","sabato",,"https://ricette.giallozafferano.it/Polpette-al-sugo.html" +"2022-02-20","domenica",, +"2022-02-21","lunedì",, +"2022-02-22","martedì",, +"2022-02-23","mercoledì",, +"2022-02-24","giovedì",,"https://ricette.giallozafferano.it/Orata-al-forno.html" +"2022-02-25","venerdì",,"https://ricette.giallozafferano.it/Torta-rustica.html" +"2022-02-26","sabato","https://ricette.giallozafferano.it/Gnudi.html", +"2022-02-27","domenica",, +"2022-02-28","lunedì",, +"2022-03-01","martedì",, +"2022-03-02","mercoledì",,"https://ricette.giallozafferano.it/Mezze-maniche-al-tonno.html" +"2022-03-03","giovedì",, +"2022-03-04","venerdì",, +"2022-03-05","sabato",, +"2022-03-06","domenica","https://ricette.giallozafferano.it/Torta-Pasqualina.html", +"2022-03-07","lunedì",, +"2022-03-08","martedì",,"https://ricette.giallozafferano.it/Strozzapreti-cacio-cozze-e-pepe.html" +"2022-03-09","mercoledì",,"https://ricette.giallozafferano.it/Saltimbocca-alla-Romana.html" +"2022-03-10","giovedì",, +"2022-03-11","venerdì",, +"2022-03-12","sabato",,"https://ricette.giallozafferano.it/Costine-al-forno.html" +"2022-03-13","domenica",, +"2022-03-14","lunedì",, +"2022-03-15","martedì",, +"2022-03-16","mercoledì",, +"2022-03-17","giovedì",,"https://ricette.giallozafferano.it/Filetti-di-salmone-su-julienne-di-cavoletti-di-bruxelles-porri-e-carote.html" +"2022-03-18","venerdì",,"https://ricette.giallozafferano.it/Torta-rustica.html" +"2022-03-19","sabato",, +"2022-03-20","domenica",, +"2022-03-21","lunedì",, +"2022-03-22","martedì",, +"2022-03-23","mercoledì",, +"2022-03-24","giovedì",, +"2022-03-25","venerdì",, +"2022-03-26","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html", +"2022-03-27","domenica",, +"2022-03-28","lunedì",, +"2022-03-29","martedì",, +"2022-03-30","mercoledì",, +"2022-03-31","giovedì",, +"2022-04-01","venerdì",, +"2022-04-02","sabato",, +"2022-04-03","domenica",, +"2022-04-04","lunedì",, +"2022-04-05","martedì",, +"2022-04-06","mercoledì",, +"2022-04-07","giovedì",, +"2022-04-08","venerdì",, +"2022-04-09","sabato",, +"2022-04-10","domenica",, +"2022-04-11","lunedì",, +"2022-04-12","martedì",, +"2022-04-13","mercoledì",,"https://ricette.giallozafferano.it/Mezze-maniche-al-tonno.html" +"2022-04-14","giovedì",, +"2022-04-15","venerdì",, +"2022-04-16","sabato",,"https://ricette.giallozafferano.it/Couscous-alla-marocchina.html" +"2022-04-17","domenica",, +"2022-04-18","lunedì",, +"2022-04-19","martedì",, +"2022-04-20","mercoledì",, +"2022-04-21","giovedì",, +"2022-04-22","venerdì",,"https://ricette.giallozafferano.it/Risotto-agli-asparagi-e-scampi.html" +"2022-04-23","sabato",, +"2022-04-24","domenica","https://ricette.giallozafferano.it/Torta-Pasqualina.html", +"2022-04-25","lunedì",, +"2022-04-26","martedì",, +"2022-04-27","mercoledì",,"https://ricette.giallozafferano.it/Orata-al-forno.html" +"2022-04-28","giovedì",, +"2022-04-29","venerdì",,"https://ricette.giallozafferano.it/Cordon-bleu-di-melanzane.html" +"2022-04-30","sabato",, +"2022-05-01","domenica",, +"2022-05-02","lunedì",, +"2022-05-03","martedì",, +"2022-05-04","mercoledì",, +"2022-05-05","giovedì",, +"2022-05-06","venerdì",, +"2022-05-07","sabato",, +"2022-05-08","domenica",, +"2022-05-09","lunedì",, +"2022-05-10","martedì",, +"2022-05-11","mercoledì",,"https://ricette.giallozafferano.it/Mezze-maniche-al-tonno.html" +"2022-05-12","giovedì",, +"2022-05-13","venerdì",, +"2022-05-14","sabato",, +"2022-05-15","domenica",, +"2022-05-16","lunedì",, +"2022-05-17","martedì",, +"2022-05-18","mercoledì",,"https://ricette.giallozafferano.it/Risotto-agli-asparagi-e-scampi.html" +"2022-05-19","giovedì",, +"2022-05-20","venerdì",, +"2022-05-21","sabato",,"https://ricette.giallozafferano.it/Couscous-alla-marocchina.html" +"2022-05-22","domenica","https://ricette.giallozafferano.it/Orata-al-forno.html", +"2022-05-23","lunedì",, +"2022-05-24","martedì",, +"2022-05-25","mercoledì",, +"2022-05-26","giovedì",,"https://ricette.giallozafferano.it/Saltimbocca-alla-Romana.html" +"2022-05-27","venerdì",, +"2022-05-28","sabato",, +"2022-05-29","domenica","https://ricette.giallozafferano.it/Polpo-alla-Luciana.html", +"2022-05-30","lunedì",, +"2022-05-31","martedì",, +"2022-06-01","mercoledì",,"https://ricette.giallozafferano.it/Riso-alla-cantonese.html" +"2022-06-02","giovedì",, +"2022-06-03","venerdì",, +"2022-06-04","sabato",, +"2022-06-05","domenica",, +"2022-06-06","lunedì",, +"2022-06-07","martedì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" +"2022-06-08","mercoledì",, +"2022-06-09","giovedì",, +"2022-06-10","venerdì",,"https://ricette.giallozafferano.it/Verdure-gratinate-al-forno.html" +"2022-06-11","sabato",, +"2022-06-12","domenica",,"https://ricette.giallozafferano.it/Riso-alla-cantonese.html" +"2022-06-13","lunedì",,"https://ricette.giallozafferano.it/Petto-di-pollo-ai-peperoni.html" +"2022-06-14","martedì",,"https://ricette.giallozafferano.it/Insalata-di-pasta-Mediterranea.html" +"2022-06-15","mercoledì",,"https://ricette.giallozafferano.it/Cocotte-di-quinoa.html" +"2022-06-16","giovedì",, +"2022-06-17","venerdì",,"https://ricette.giallozafferano.it/Salmorejo.html" +"2022-06-18","sabato","https://ricette.giallozafferano.it/Insalata-di-ceci-estiva.html", +"2022-06-19","domenica",, +"2022-06-20","lunedì",, +"2022-06-21","martedì",, +"2022-06-22","mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" +"2022-06-23","giovedì",, +"2022-06-24","venerdì",, +"2022-06-25","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html", +"2022-06-26","domenica",, +"2022-06-27","lunedì",, +"2022-06-28","martedì",, +"2022-06-29","mercoledì",, +"2022-06-30","giovedì",, +"2022-07-01","venerdì",, +"2022-07-02","sabato",, +"2022-07-03","domenica",, +"2022-07-04","lunedì",, +"2022-07-05","martedì",,"https://ricette.giallozafferano.it/Insalata-di-ceci-estiva.html" +"2022-07-06","mercoledì",,"https://ricette.giallozafferano.it/Pasta-con-le-melanzane.html" +"2022-07-07","giovedì",, +"2022-07-08","venerdì",, +"2022-07-09","sabato",, +"2022-07-10","domenica",, +"2022-07-11","lunedì",, +"2022-07-12","martedì",, +"2022-07-13","mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" +"2022-07-14","giovedì",, +"2022-07-15","venerdì",,"https://ricette.giallozafferano.it/Salmorejo.html" +"2022-07-16","sabato",, +"2022-07-17","domenica",, +"2022-07-18","lunedì",, +"2022-07-19","martedì",,"https://ricette.giallozafferano.it/Verdure-gratinate-al-forno.html" +"2022-07-20","mercoledì",, +"2022-07-21","giovedì",,"https://ricette.giallozafferano.it/Insalata-di-pasta-Mediterranea.html" +"2022-07-22","venerdì",, +"2022-07-23","sabato",,"https://ricette.giallozafferano.it/Cocotte-di-quinoa.html" +"2022-07-24","domenica",, +"2022-07-25","lunedì",, +"2022-07-26","martedì",, +"2022-07-27","mercoledì",, +"2022-07-28","giovedì",, +"2022-07-29","venerdì",,"https://ricette.giallozafferano.it/Orata-al-forno.html" +"2022-07-30","sabato",, +"2022-07-31","domenica",, "2022-08-01","lunedì",,"https://ricette.giallozafferano.it/Riso-freddo-con-tonno-zucchine-e-limone.html" "2022-08-02","martedì",, -"2022-08-03","mercoledì",, -"2022-08-04","giovedì",, +"2022-08-03","mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" +"2022-08-04","giovedì",,"https://ricette.giallozafferano.it/Petto-di-pollo-ai-peperoni.html" "2022-08-05","venerdì",, "2022-08-06","sabato",, "2022-08-07","domenica",, "2022-08-08","lunedì",, -"2022-08-09","martedì",, +"2022-08-09","martedì",,"https://ricette.giallozafferano.it/Insalata-di-pasta-Mediterranea.html" "2022-08-10","mercoledì",, -"2022-08-11","giovedì",, +"2022-08-11","giovedì",,"https://ricette.giallozafferano.it/Verdure-gratinate-al-forno.html" "2022-08-12","venerdì",, "2022-08-13","sabato",, "2022-08-14","domenica",, -"2022-08-15","lunedì",, +"2022-08-15","lunedì",,"https://ricette.giallozafferano.it/Pasta-con-le-melanzane.html" "2022-08-16","martedì",, -"2022-08-17","mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" +"2022-08-17","mercoledì",,"https://ricette.giallozafferano.it/Cocotte-di-quinoa.html" "2022-08-18","giovedì",, "2022-08-19","venerdì",, "2022-08-20","sabato",,"https://ricette.giallozafferano.it/Salmorejo.html" "2022-08-21","domenica",, "2022-08-22","lunedì",, "2022-08-23","martedì",, -"2022-08-24","mercoledì",, +"2022-08-24","mercoledì",,"https://ricette.giallozafferano.it/Pasta-fredda-con-pesto-senz-aglio.html" "2022-08-25","giovedì",, "2022-08-26","venerdì",, -"2022-08-27","sabato",, +"2022-08-27","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html", "2022-08-28","domenica",, "2022-08-29","lunedì",, "2022-08-30","martedì",, "2022-08-31","mercoledì",, "2022-09-01","giovedì",, -"2022-09-02","venerdì",, +"2022-09-02","venerdì",,"https://ricette.giallozafferano.it/Petto-di-pollo-ai-peperoni.html" "2022-09-03","sabato",, "2022-09-04","domenica",, "2022-09-05","lunedì",, "2022-09-06","martedì",, "2022-09-07","mercoledì",, -"2022-09-08","giovedì",, +"2022-09-08","giovedì",,"https://ricette.giallozafferano.it/Pasta-con-le-melanzane.html" "2022-09-09","venerdì",, "2022-09-10","sabato",, -"2022-09-11","domenica",, -"2022-09-12","lunedì",, +"2022-09-11","domenica","https://ricette.giallozafferano.it/Polpo-alla-Luciana.html", +"2022-09-12","lunedì",,"https://ricette.giallozafferano.it/Pennette-con-speck-e-zucchine.html" "2022-09-13","martedì",, -"2022-09-14","mercoledì",, +"2022-09-14","mercoledì",,"https://ricette.giallozafferano.it/Scaloppine-ai-funghi.html" "2022-09-15","giovedì",, -"2022-09-16","venerdì",, +"2022-09-16","venerdì",,"https://ricette.giallozafferano.it/Cordon-bleu-di-melanzane.html" "2022-09-17","sabato",, "2022-09-18","domenica",, "2022-09-19","lunedì",, "2022-09-20","martedì",, -"2022-09-21","mercoledì",, -"2022-09-22","giovedì",, +"2022-09-21","mercoledì",,"https://ricette.giallozafferano.it/Strozzapreti-cacio-cozze-e-pepe.html" +"2022-09-22","giovedì",,"https://ricette.giallozafferano.it/Vellutata-di-porri-con-crostini-saporiti.html" "2022-09-23","venerdì",, -"2022-09-24","sabato",, -"2022-09-25","domenica",, -"2022-09-26","lunedì",, +"2022-09-24","sabato","https://ricette.giallozafferano.it/Gnudi.html", +"2022-09-25","domenica","https://ricette.giallozafferano.it/Pollo-alla-cacciatora.html", +"2022-09-26","lunedì",,"https://ricette.giallozafferano.it/Mezze-maniche-al-tonno.html" "2022-09-27","martedì",, -"2022-09-28","mercoledì",, +"2022-09-28","mercoledì",,"https://ricette.giallozafferano.it/Orata-al-forno.html" "2022-09-29","giovedì",, "2022-09-30","venerdì",, "2022-10-01","sabato",, -"2022-10-02","domenica",, +"2022-10-02","domenica","https://ricette.giallozafferano.it/Gnocchi-alla-sorrentina.html", "2022-10-03","lunedì",, -"2022-10-04","martedì",, +"2022-10-04","martedì",,"https://ricette.giallozafferano.it/Spatzle-di-spinaci.html" "2022-10-05","mercoledì",, -"2022-10-06","giovedì",, -"2022-10-07","venerdì",, -"2022-10-08","sabato",, +"2022-10-06","giovedì",,"https://ricette.giallozafferano.it/Saltimbocca-alla-Romana.html" +"2022-10-07","venerdì",,"https://ricette.giallozafferano.it/Risotto-ai-funghi.html" +"2022-10-08","sabato","https://ricette.giallozafferano.it/Torta-Pasqualina.html", "2022-10-09","domenica",, -"2022-10-10","lunedì",, +"2022-10-10","lunedì",,"https://ricette.giallozafferano.it/Pennette-con-speck-e-zucchine.html" "2022-10-11","martedì",, "2022-10-12","mercoledì",, "2022-10-13","giovedì",, -"2022-10-14","venerdì",, +"2022-10-14","venerdì",,"https://ricette.giallozafferano.it/Polpette-al-sugo.html" "2022-10-15","sabato",, "2022-10-16","domenica",, "2022-10-17","lunedì",, "2022-10-18","martedì",, -"2022-10-19","mercoledì",, +"2022-10-19","mercoledì",,"https://ricette.giallozafferano.it/Scaloppine-ai-funghi.html" "2022-10-20","giovedì",, "2022-10-21","venerdì",, -"2022-10-22","sabato",, +"2022-10-22","sabato","https://ricette.giallozafferano.it/Gnudi.html", "2022-10-23","domenica",, "2022-10-24","lunedì",, "2022-10-25","martedì",, "2022-10-26","mercoledì",, "2022-10-27","giovedì",, -"2022-10-28","venerdì",, -"2022-10-29","sabato",, +"2022-10-28","venerdì",,"https://ricette.giallozafferano.it/Vellutata-di-zucca-e-carote.html" +"2022-10-29","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html", "2022-10-30","domenica",, "2022-10-31","lunedì",, "2022-11-01","martedì",, "2022-11-02","mercoledì",, "2022-11-03","giovedì",, "2022-11-04","venerdì",, -"2022-11-05","sabato",, +"2022-11-05","sabato","https://ricette.giallozafferano.it/Spatzle-di-spinaci.html", "2022-11-06","domenica",, "2022-11-07","lunedì",, "2022-11-08","martedì",, "2022-11-09","mercoledì",, "2022-11-10","giovedì",, -"2022-11-11","venerdì",, -"2022-11-12","sabato",, +"2022-11-11","venerdì",,"https://ricette.giallozafferano.it/Vellutata-di-porri-con-crostini-saporiti.html" +"2022-11-12","sabato",,"https://ricette.giallozafferano.it/Chili-con-carne.html" "2022-11-13","domenica",, "2022-11-14","lunedì",, "2022-11-15","martedì",, "2022-11-16","mercoledì",, "2022-11-17","giovedì",, -"2022-11-18","venerdì",, +"2022-11-18","venerdì",,"https://ricette.giallozafferano.it/Torta-rustica.html" "2022-11-19","sabato",, "2022-11-20","domenica",, "2022-11-21","lunedì",, "2022-11-22","martedì",, "2022-11-23","mercoledì",, "2022-11-24","giovedì",, -"2022-11-25","venerdì",, -"2022-11-26","sabato",, +"2022-11-25","venerdì",,"https://ricette.giallozafferano.it/Vellutata-di-zucca-e-carote.html" +"2022-11-26","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html", "2022-11-27","domenica",, "2022-11-28","lunedì",, -"2022-11-29","martedì",, +"2022-11-29","martedì",,"https://ricette.giallozafferano.it/Scaloppine-ai-funghi.html" "2022-11-30","mercoledì",, "2022-12-01","giovedì",, "2022-12-02","venerdì",, "2022-12-03","sabato",, "2022-12-04","domenica",, -"2022-12-05","lunedì",, +"2022-12-05","lunedì",,"https://ricette.giallozafferano.it/Spatzle-di-spinaci.html" "2022-12-06","martedì",, "2022-12-07","mercoledì",, "2022-12-08","giovedì",, "2022-12-09","venerdì",, -"2022-12-10","sabato",, +"2022-12-10","sabato","https://ricette.giallozafferano.it/Gnudi.html", "2022-12-11","domenica",, "2022-12-12","lunedì",, "2022-12-13","martedì",, -"2022-12-14","mercoledì",, -"2022-12-15","giovedì",, +"2022-12-14","mercoledì",,"https://ricette.giallozafferano.it/Risotto-ai-funghi.html" +"2022-12-15","giovedì",,"https://ricette.giallozafferano.it/Vellutata-di-porri-con-crostini-saporiti.html" "2022-12-16","venerdì",, "2022-12-17","sabato",, -"2022-12-18","domenica",, +"2022-12-18","domenica","https://ricette.giallozafferano.it/Polpette-al-sugo.html", "2022-12-19","lunedì",, "2022-12-20","martedì",, "2022-12-21","mercoledì",, "2022-12-22","giovedì",, "2022-12-23","venerdì",, "2022-12-24","sabato",, -"2022-12-25","domenica",, +"2022-12-25","domenica","https://ricette.giallozafferano.it/Filetto-in-crosta.html", "2022-12-26","lunedì",, "2022-12-27","martedì",, -"2022-12-28","mercoledì",, +"2022-12-28","mercoledì",,"https://ricette.giallozafferano.it/Orata-al-forno.html" "2022-12-29","giovedì",, "2022-12-30","venerdì",, -"2022-12-31","sabato",, +"2022-12-31","sabato",, \ No newline at end of file diff --git a/src/api_client.rs b/src/api_client.rs index 59827b1..960503d 100644 --- a/src/api_client.rs +++ b/src/api_client.rs @@ -4,11 +4,12 @@ use { crate::config::Config, crate::constants, anyhow::anyhow, anyhow::Result, base64::write::EncoderWriter as Base64Encoder, chrono::DateTime, icalendar::CalendarComponent, - reqwest::Url, std::io::Write, std::ops::Range, + reqwest::Url, std::io::Write, std::ops::Range, std::sync::Arc, tokio::sync::Semaphore, }; pub struct ApiClient { rest: reqwest::Client, + pub(crate) rest_semaphore: Arc, // TODO: wrap in dereferentiable struct base_url: Url, caldav_base_url: Url, username: String, @@ -59,6 +60,7 @@ impl ApiClient { caldav_base_url, username: server.login_name.clone(), rest: rest_client, + rest_semaphore: Arc::new(Semaphore::new(5)), }) } diff --git a/src/commands/schedule_csv.rs b/src/commands/schedule_csv.rs index b160b8d..69298cb 100644 --- a/src/commands/schedule_csv.rs +++ b/src/commands/schedule_csv.rs @@ -97,6 +97,7 @@ async fn get_all_recipes(api_client: &ApiClient) -> Result().await.map(|r| Rc::new(r)) }); @@ -134,7 +135,7 @@ where &helpers::ical_escape_text(&ev.recipe.name) ); - log::info!( + let info_message = format!( "Saving event at {} for '{}'", &ev.ends_at.date(), &ev.recipe.name @@ -157,13 +158,20 @@ where 1, ); - api_client + // TODO: wrap this + let _ = api_client.rest_semaphore.acquire().await.unwrap(); + log::info!("{}", info_message); + let response = api_client .rest() .put(url) .header("Content-Type", "text/calendar; charset=utf-8") .body(cal_as_string) .send() - .await + .await; + + // TODO: magic numbers are bad... + std::thread::sleep(std::time::Duration::from_millis(300)); + response }); let responses = try_join_all(update_requests).await?;