-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·54 lines (41 loc) · 1.54 KB
/
setup
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python
import json as _json
print "\nThanks for downloading Twitter Group Chat!"
print "\nTo get setup, we need Twitter OAuth tokens."
print "Get them here: http://dev.twitter.com"
print "-" * 60
CONFIG = open('.env', 'w')
##
# Set these 6 global varaibles to customize your bot.
##
# Register and create tokens at http://dev.twitter.com
CONSUMER_KEY = raw_input('\nEnter your consumer key:\n')
CONFIG.write("CONSUMER_KEY=%s\n" % CONSUMER_KEY)
CONSUMER_SECRET = raw_input('\nEnter your consumer secret:\n')
CONFIG.write("CONSUMER_SECRET=%s\n" % CONSUMER_SECRET)
ACCESS_TOKEN = raw_input('\nEnter your access token:\n')
CONFIG.write("ACCESS_TOKEN=%s\n" % ACCESS_TOKEN)
ACCESS_SECRET = raw_input('\nEnter your access token secret:\n')
CONFIG.write("ACCESS_SECRET=%s\n" % ACCESS_SECRET)
BOT_NAME = raw_input('\nEnter the bot\'s Twitter handle (no @):\n').lstrip('@')
CONFIG.write("BOT_NAME=%s\n" % BOT_NAME)
FRIENDS = []
print "\nNow add some friends' Twitter names!"
print " (No @ necessary.)\n"
_adding = True
_counter = 1
while _adding:
FRIENDS.append(raw_input('#%s: ' % _counter).lstrip('@'))
_counter += 1
if raw_input('Want to add more? (Y / N): ').lower() != 'y':
_adding = False
CONFIG.write("FRIENDS=%s\n" % _json.dumps(FRIENDS))
CONFIG.close()
print "\nAll done configuring, thanks for using Group Chat!\n"
print """
For Heroku hosting (the simplist IMO):
* `heroku create [optional name]`
* `git push heroku master`
* `heroku ps:scale worker=1`
* Test by tweeting at the bot / checking `heroku logs`
"""