adding fetching and saving an entire book

This commit is contained in:
github_username_here
2026-03-10 17:48:17 +01:00
parent 7355158ff9
commit 874ba49512
157 changed files with 31768 additions and 32 deletions

View File

@@ -30,10 +30,10 @@ func main (){
cfg := config.Cfg{
ConfigPath: "internal/config/",
YamlPath: "data",
HtmlPath: "Public",
HtmlPath: "public",
BookList: map[string]int{
"ps": 150,
"pr": 31,
"Psaumes": 150,
"Proverbes": 31,
},
Book: book,
@@ -49,20 +49,21 @@ func main (){
searchedChapter := "2"
err = fetcher.FetchChapter(&cfg, searchedChapter)
err = fetcher.FetchBook(&cfg)
if err != nil {
log.Printf("GET %s %s %s failed\n", book, searchedChapter, cfg.Book.Version)
os.Exit(1)
}
/*
for i, verse := range cfg.Book.Chapters[0].Verses{
log.Printf("==== Verse: %v ====", i+1)
fetcher.SplitInPart(verse, properName)
/* err = fetcher.SaveChapter(cfg, &cfg.Book.Chapters[0])
if err != nil{
log.Printf("error in saving the chapter:%v", err)
}
*/
*/
log.Printf("%v", cfg.Book.Chapters)
os.Exit(0)
}