mirror of
https://github.com/sigmasternchen/wikitil
synced 2025-03-15 08:09:00 +00:00
17 lines
No EOL
484 B
Go
17 lines
No EOL
484 B
Go
package twitter
|
|
|
|
import (
|
|
"github.com/dghubble/go-twitter/twitter"
|
|
appConfig "wikitil/internal/config"
|
|
)
|
|
import "github.com/dghubble/oauth1"
|
|
|
|
var client *twitter.Client
|
|
|
|
func Init(appConfig appConfig.Config, access appConfig.AccessConfig) {
|
|
config := oauth1.NewConfig(appConfig.ConsumerKey, appConfig.ConsumerSecret)
|
|
token := oauth1.NewToken(access.AccessToken, access.AccessSecret)
|
|
httpClient := config.Client(oauth1.NoContext, token)
|
|
|
|
client = twitter.NewClient(httpClient)
|
|
} |