You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
383 B

package oauth2
import (
"net/http"
"os"
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
)
func GetClient() *http.Client {
config := &clientcredentials.Config{
ClientID: os.Getenv("TWITTER_API_KEY"),
ClientSecret: os.Getenv("TWITTER_API_SECRET_KEY"),
TokenURL: "https://api.twitter.com/oauth2/token",
}
return config.Client(oauth2.NoContext)
}