Add rest of project files
This commit is contained in:
0
app/__init__.py
Normal file
0
app/__init__.py
Normal file
8
app/fact_bot.py
Normal file
8
app/fact_bot.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from app import fact_service, groupme
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Get Groupme api token to post with
|
||||
groupme_client = groupme.get_client()
|
||||
|
||||
# Get Random Fact
|
||||
fact = fact_service.get_random_fact()
|
||||
4
app/fact_service.py
Normal file
4
app/fact_service.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def get_random_fact():
|
||||
ret_fact = None
|
||||
|
||||
return ret_fact
|
||||
18
app/groupme.py
Normal file
18
app/groupme.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from groupy import Client
|
||||
|
||||
from util import api_keys
|
||||
|
||||
GROUPME_CLIENT = None
|
||||
|
||||
|
||||
def get_client():
|
||||
if GROUPME_CLIENT is None:
|
||||
init_client()
|
||||
return GROUPME_CLIENT
|
||||
|
||||
|
||||
def init_client():
|
||||
global GROUPME_CLIENT
|
||||
GROUPME_CLIENT = Client.from_token(api_keys.GROUPME)
|
||||
if not list(GROUPME_CLIENT.groups.list_all()):
|
||||
raise Exception("Invalid groupme token or not apart of any groups.")
|
||||
Reference in New Issue
Block a user