func (w *WikipediaJSONSpider) Setup(ctx *spider.Context) (*spider.Context, error) { params := url.Values{} params.Add("titles", w.Title) url := fmt.Sprintf("http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&%s", params.Encode()) return spider.NewHTTPContext("GET", url, nil) }
func (w *WikipediaHTMLSpider) Setup(ctx *spider.Context) (*spider.Context, error) { url := fmt.Sprintf("https://en.wikipedia.org/wiki/%s", w.Title) return spider.NewHTTPContext("GET", url, nil) }