Add newRequest function with common headers

This commit is contained in:
Alexander Sheiko 2020-06-15 11:59:30 +03:00
parent 2dc80b95cf
commit c12927172f
4 changed files with 18 additions and 14 deletions

View file

@ -1,8 +1,6 @@
package twitterscraper
import (
"net/http"
"github.com/PuerkitoBio/goquery"
)
@ -10,7 +8,7 @@ const trendsURL = "https://twitter.com/i/trends"
// GetTrends return list of trends.
func GetTrends() ([]string, error) {
req, err := http.NewRequest("GET", trendsURL, nil)
req, err := newRequest(trendsURL)
if err != nil {
return nil, err
}