func getReleases() []map[string]interface{} { response, _ := request.Get(Url, map[string]string{}) defer response.Body.Close() body, _ := ioutil.ReadAll(response.Body) if err := json.Unmarshal(body, &releases); err != nil { panic(err) } return releases }
// Get the document for the link. // Requests the page with a randomized user-agent // so Google doesn't get suspicious. ಠ_ಠ func (p *Page) Fetch() (*goquery.Document, error) { var response *http.Response var doc *goquery.Document var e error if response, e = request.Get(p.Url, map[string]string{ "User-Agent": userAgents[rand.Intn(len(userAgents))], }); e != nil { return nil, e } if doc, e = goquery.NewDocumentFromResponse(response); e != nil { panic(e.Error()) } return doc, nil }