Add newRequest function with common headers
This commit is contained in:
parent
2dc80b95cf
commit
c12927172f
4 changed files with 18 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue