Beispiel #1
0
// If the territory has different keys to use
func NewTwitterTerritoryCredentials(territory string) {
	for _, t := range harvestConfig.Territories {
		if t.Name == territory {
			if t.Services.Twitter.ApiKey != "" && t.Services.Twitter.ApiSecret != "" && t.Services.Twitter.AccessToken != "" && t.Services.Twitter.AccessTokenSecret != "" {
				anaconda.SetConsumerKey(t.Services.Twitter.ApiKey)
				anaconda.SetConsumerSecret(t.Services.Twitter.ApiSecret)
				services.twitter = anaconda.NewTwitterApi(t.Services.Twitter.AccessToken, t.Services.Twitter.AccessTokenSecret)
			}
		}
	}
}
Beispiel #2
0
func NewTwitter(servicesConfig config.ServicesConfig) {
	anaconda.SetConsumerKey(servicesConfig.Twitter.ApiKey)
	anaconda.SetConsumerSecret(servicesConfig.Twitter.ApiSecret)
	services.twitter = anaconda.NewTwitterApi(servicesConfig.Twitter.AccessToken, servicesConfig.Twitter.AccessTokenSecret)
}