|
@ -5,6 +5,7 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"io/ioutil" |
|
|
"io/ioutil" |
|
|
"os" |
|
|
"os" |
|
|
|
|
|
"regexp" |
|
|
"strings" |
|
|
"strings" |
|
|
|
|
|
|
|
|
"github.com/PuerkitoBio/goquery" |
|
|
"github.com/PuerkitoBio/goquery" |
|
@ -34,6 +35,7 @@ var ( |
|
|
"Mensa+Italia": "mensaitalia", |
|
|
"Mensa+Italia": "mensaitalia", |
|
|
"Bistro+HAWK": "bistrohawk", |
|
|
"Bistro+HAWK": "bistrohawk", |
|
|
} |
|
|
} |
|
|
|
|
|
trimRegex = regexp.MustCompile(`\s{2,}`) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
@ -93,9 +95,7 @@ func parseDate(doc *goquery.Document) string { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func strip(old string) string { |
|
|
func strip(old string) string { |
|
|
new := strings.Replace(old, "\t", "", -1) |
|
|
|
|
|
new = strings.Replace(new, "\n", "", -1) |
|
|
|
|
|
return new |
|
|
|
|
|
|
|
|
return strings.TrimSpace(trimRegex.ReplaceAllString(old, " ")) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func parseMeals(doc *goquery.Document) ([]Meal, error) { |
|
|
func parseMeals(doc *goquery.Document) ([]Meal, error) { |
|
|