[twitter] Add model and webapi stub for twitter

This commit is contained in:
Cathy Hu 2020-07-05 20:33:58 +02:00 committed by acipm
parent fbf3a911bd
commit e84ac9d6bb
3 changed files with 28 additions and 0 deletions

View file

View file

@ -0,0 +1,18 @@
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
#
# 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'

View file

@ -0,0 +1,10 @@
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
#
# SPDX-License-Identifier: 0BSD
from fastapi import APIRouter
from kibicara.platforms.twitter.bot import spawner
from kibicara.platforms.twitter.model import Twitter
router = APIRouter()