-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·41 lines (35 loc) · 1.08 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tweebot
TEMPLATES = [
"@%s Are you sure you didn't mean, whether or not?",
"@%s I think you meant, whether or not.",
"@%s I don't think rain has anything to do with it.",
"@%s Indecisive meteorology! My favorite.",
]
class Ithinkyoumeant(tweebot.Context):
def __init__(self, *args, **kwargs):
settings = {
'app_name' : 'ithinkyoumeant',
'username' : '<YOUR ACCOUNT NAME>',
'consumer_key' : '<YOUR CONSUMER KEY>',
'consumer_secret': '<YOUR CONSUMER SECRET>',
'access_key' : '<YOUR ACCESS KEY>',
'access_secret' : '<YOUR ACCESS SECRET>',
'timeout' : 30 * 60, # 30 min
'history_file' : 'ithinkyoumeant.history',
'testing' : True
}
super(Complementor, self).__init__(settings)
def main():
bot = Ithinkyoumeant()
tweebot.enable_logging(bot)
bot.start_forever(
tweebot.MultiPart.Add(
tweebot.SearchMentions(),
tweebot.SearchQuery('"weather or not"')),
tweebot.MultiPart.And(
tweebot.BaseFilter),
tweebot.ReplyTemplate(TEMPLATES))
if __name__ == '__main__':
main()