|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
"fmt" |
|
|
|
"io/ioutil" |
|
|
|
"os" |
|
|
|
"regexp" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"github.com/PuerkitoBio/goquery" |
|
|
@ -34,6 +35,7 @@ var ( |
|
|
|
"Mensa+Italia": "mensaitalia", |
|
|
|
"Bistro+HAWK": "bistrohawk", |
|
|
|
} |
|
|
|
trimRegex = regexp.MustCompile(`\s{2,}`) |
|
|
|
) |
|
|
|
|
|
|
|
func main() { |
|
|
@ -93,9 +95,7 @@ func parseDate(doc *goquery.Document) 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) { |
|
|
|