Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Twitter ¶
type Twitter struct { API TwitterAPI Configuration *anaconda.Configuration Mutex *sync.Mutex }
Twitter is the data structure to reflect the twitter client
func NewClient ¶
func NewClient(consumerKey, consumerSecret, accessToken, accessTokenSecret string, debug bool) *Twitter
NewClient returns a new client to communicate with twitter. If debug is enabled, we will load a debug configuration for the twitter client.
func (*Twitter) FollowNewPerson ¶
FollowNewPerson will follow a new person on twitter to raise the attraction for the bot. We will follow a new person who follow on random follower of @TrendingGithub Only persons who don`t have a relationship to the bot will be followed.
func (*Twitter) LoadConfiguration ¶
LoadConfiguration loads the configuration of the twitter client from twitter. See https://dev.twitter.com/rest/reference/get/help/configuration
func (*Twitter) SetupConfigurationRefresh ¶
SetupConfigurationRefresh sets up a scheduler and will refresh the configuration from twitter every duration d. The reason for this is that these values can change over time. See https://dev.twitter.com/rest/reference/get/help/configuration
func (*Twitter) SetupFollowNewPeopleScheduling ¶
SetupFollowNewPeopleScheduling sets up a scheduler and will search for a new person to follow every duration d. This is our growth hack feature.
type TwitterAPI ¶
type TwitterAPI interface { GetConfiguration(v url.Values) (conf anaconda.Configuration, err error) PostTweet(status string, v url.Values) (tweet anaconda.Tweet, err error) GetFollowersIds(v url.Values) (c anaconda.Cursor, err error) GetFriendshipsLookup(v url.Values) (friendships []anaconda.Friendship, err error) FollowUserId(userId int64, v url.Values) (user anaconda.User, err error) }
TwitterAPI is the interface to decouple the twitter API.