diff --git a/meta.sample.json b/meta.sample.json new file mode 100644 index 0000000..0e5d7e5 --- /dev/null +++ b/meta.sample.json @@ -0,0 +1,4 @@ +{ + "name":"Curious Greg", + "website":"https://git.lynnesbian.space/lynnesbian/curious-greg", +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ae09db0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Flask==1.0.2 \ No newline at end of file diff --git a/web.py b/web.py old mode 100644 new mode 100755 index 1c3c6e4..acf0b71 --- a/web.py +++ b/web.py @@ -6,27 +6,28 @@ import requests, sqlite3, json from mastodon import Mastodon -from flask import Flask, session -from flask.ext.session import Session +from flask import Flask cfg = json.load(open("meta.json")) -app = Flask(cfg['name']) -SESSION_TYPE = 'filesystem' -app.config.from_object(cfg['name']) -Session(app) - db = sqlite3.connect("database.db") c = db.cursor() - c.execute("CREATE TABLE IF NOT EXISTS `data` (username VARCHAR NOT NULL, appid VARCHAR NOT NULL, appsecret VARCHAR NOT NULL, secret VARCHAR NOT NULL, latest_post VARCHAR)") -print("Registering app...") -client_id, client_secret = Mastodon.create_app(cfg['name'], - api_base_url=instance_url, - scopes="write:statuses", - website="https://git.lynnesbian.space/lynnesbian/curious-greg") +app = Flask(cfg['name']) -client = Mastodon(client_id = client_id, - client_secret = client_secret, - api_base_url=instance_url) + +@app.route('/login') +def auth(): + + +@app.route('/internal/auth_a') +def internal_auth_a(): + client_id, client_secret = Mastodon.create_app(cfg['name'], + api_base_url=instance_url, + scopes="write:statuses", + website="https://git.lynnesbian.space/lynnesbian/curious-greg") + + client = Mastodon(client_id = client_id, + client_secret = client_secret, + api_base_url=instance_url)