|
@ -1,9 +1,11 @@ |
|
|
package main |
|
|
package main |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"crypto/tls" |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"io/ioutil" |
|
|
"io/ioutil" |
|
|
|
|
|
"net/http" |
|
|
"os" |
|
|
"os" |
|
|
"regexp" |
|
|
"regexp" |
|
|
"strings" |
|
|
"strings" |
|
@ -84,7 +86,13 @@ func operate(mensa string, day int) (Menu, error) { |
|
|
push = 1 |
|
|
push = 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
document, err := goquery.NewDocument(fmt.Sprintf("http://www.studentenwerk-goettingen.de/speiseplan.html?no_cache=1&day=%v&push=%v&selectmensa=%s", day, push, mensa)) |
|
|
|
|
|
|
|
|
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} |
|
|
|
|
|
res, err := http.Get(fmt.Sprintf("http://www.studentenwerk-goettingen.de/speiseplan.html?no_cache=1&day=%v&push=%v&selectmensa=%s", day, push, mensa)) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
fmt.Println(err) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document, err := goquery.NewDocumentFromResponse(res) |
|
|
|
|
|
|
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return Menu{}, err |
|
|
return Menu{}, err |
|
|