feat: add clear cookies function

This commit is contained in:
Berk Altıok 2023-07-05 22:20:56 +03:00 committed by GitHub
parent 0ba238e6a1
commit 24c31ac232

View file

@ -383,6 +383,10 @@ func (s *Scraper) SetCookies(cookies []*http.Cookie) {
s.client.Jar.SetCookies(twURL, cookies)
}
func (s *Scraper) ClearCookies() {
s.client.Jar, _ = cookiejar.New(nil)
}
func (s *Scraper) sign(method string, ref *url.URL) string {
m := make(map[string]string)
m["oauth_consumer_key"] = appConsumerKey