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