From e84ac9d6bb09cb184a6cd94f00b9b459d164085f Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Sun, 5 Jul 2020 20:33:58 +0200 Subject: [PATCH] [twitter] Add model and webapi stub for twitter --- kibicara/platforms/twitter/__init__.py | 0 kibicara/platforms/twitter/model.py | 18 ++++++++++++++++++ kibicara/platforms/twitter/webapi.py | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 kibicara/platforms/twitter/__init__.py create mode 100644 kibicara/platforms/twitter/model.py create mode 100644 kibicara/platforms/twitter/webapi.py diff --git a/kibicara/platforms/twitter/__init__.py b/kibicara/platforms/twitter/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kibicara/platforms/twitter/model.py b/kibicara/platforms/twitter/model.py new file mode 100644 index 0000000..772b16e --- /dev/null +++ b/kibicara/platforms/twitter/model.py @@ -0,0 +1,18 @@ +# Copyright (C) 2020 by Cathy Hu +# +# SPDX-License-Identifier: 0BSD + +from kibicara.model import Hood, Mapping +from ormantic import Integer, ForeignKey, Model, Text + + +class Twitter(Model): + id: Integer(primary_key=True) = None + hood: ForeignKey(Hood) + dms_since_id: Integer() + mentions_since_id: Integer() + access_token: Text() + access_token_secret: Text() + + class Mapping(Mapping): + table_name = 'twitterbots' diff --git a/kibicara/platforms/twitter/webapi.py b/kibicara/platforms/twitter/webapi.py new file mode 100644 index 0000000..40f6c13 --- /dev/null +++ b/kibicara/platforms/twitter/webapi.py @@ -0,0 +1,10 @@ +# Copyright (C) 2020 by Cathy Hu +# +# SPDX-License-Identifier: 0BSD + +from fastapi import APIRouter +from kibicara.platforms.twitter.bot import spawner +from kibicara.platforms.twitter.model import Twitter + + +router = APIRouter()