diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/data-collection/twitter_individual.py b/data-collection/twitter_individual.py new file mode 100644 index 0000000..f3c512c --- /dev/null +++ b/data-collection/twitter_individual.py @@ -0,0 +1,18 @@ +import os + +import json5 +import tweepy + + +def load_config() -> dict: + """ + Load config using JSON5, from either the local file ~/config.json5 or from the environment variable named config. + + :return: Config dictionary object + """ + if os.path.isfile('config.json5'): + with open('config.json5', 'r') as f: + return json5.load(f) + else: + return json5.loads(os.getenv('config')) +