Class: TwitterTopicBot
- Inherits:
-
Object
show all
- Defined in:
- lib/twitter_topic_bot.rb,
lib/twitter_topic_bot/version.rb,
lib/twitter_topic_bot/api_client.rb,
lib/twitter_topic_bot/tweet_filterer.rb
Defined Under Namespace
Classes: ApiClient, TweetFilterer
Constant Summary
collapse
- VERSION =
'0.2.0'
Instance Method Summary
collapse
Constructor Details
#initialize(content_preparer, credentials) ⇒ TwitterTopicBot
Returns a new instance of TwitterTopicBot.
7
8
9
10
|
# File 'lib/twitter_topic_bot.rb', line 7
def initialize(content_preparer, credentials)
@content_preparer = content_preparer
@api_client = TwitterTopicBot::ApiClient.new(credentials)
end
|
Instance Method Details
#follow_followers ⇒ Object
44
45
46
47
|
# File 'lib/twitter_topic_bot.rb', line 44
def follow_followers
api_client.follow *api_client.followers
end
|
#follow_someone ⇒ Object
22
23
24
|
# File 'lib/twitter_topic_bot.rb', line 22
def follow_someone
api_client.follow(user_to_follow)
end
|
#reply_to_someone ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/twitter_topic_bot.rb', line 31
def reply_to_someone
=
reply = content_preparer.prepare_reply(
.text,
.user.screen_name
)
api_client.(
reply,
in_reply_to_status_id: .id
)
end
|
26
27
28
29
|
# File 'lib/twitter_topic_bot.rb', line 26
def
api_client. *api_client.mentions
end
|
18
19
20
|
# File 'lib/twitter_topic_bot.rb', line 18
def
api_client.()
end
|
12
13
14
15
16
|
# File 'lib/twitter_topic_bot.rb', line 12
def
api_client.(
content_preparer.
)
end
|