fread/setup.py
2017-02-08 21:57:24 +01:00

31 lines
933 B
Python
Executable file

#!/usr/bin/env python3
import configparser, os.path, tweepy, dbtools, getpass
if os.path.isfile("config.cfg"):
print("config.cfg already exists. Please remove it before running this script.")
exit(1)
config = configparser.RawConfigParser()
config.add_section("Romeo")
print('''In the next step, we'll get you connected to Read.it. For this, we
will need your username and password. Please note that these will be stored on
your hard disk in plain text. Sadly Read.it doesn't offer a better way for
third party applications to authenticate...
''')
unam = input("Username: ")
pwrd = getpass.getpass("Password (not echoed back!): ")
print()
config.set("Read.it", "user", unam)
config.set("Read.it", "pass", pwrd)
print("Seems like everything worked out fine. Let's write that config file...")
with open('config.cfg', 'wt') as cfg:
config.write(cfg)
print("We're all done. You can now use the Read.it exporter. Have fun!")