modified scripts to use a folder for each day - prevent a huge package "namespace" headache

This commit is contained in:
alexchao26
2020-11-27 14:27:43 -05:00
parent 4fc1a1e94f
commit 045d73b069
6 changed files with 53 additions and 18 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ func main() {
prompt := parseHTML(body)
// write to file
filename := filepath.Join(util.Dirname(), "../../../", fmt.Sprintf("%d/day%02d-prompt.md", year, day))
filename := filepath.Join(util.Dirname(), "../../../", fmt.Sprintf("%d/day%02d/prompt.md", year, day))
fetchers.WriteToFile(filename, []byte(prompt))
fmt.Println("Wrote prompt to file: ", filename)
@@ -66,7 +66,7 @@ func dfsHTML(node *html.Node, cb func(*html.Node) []interface{}) []interface{} {
func cbFindDayDescClass(node *html.Node) []interface{} {
for _, attr := range node.Attr {
if attr.Key == "class" && attr.Val == "day-desc" {
fmt.Println("day-desc node found!")
// fmt.Println("day-desc node found!")
return []interface{}{node}
}
}