diff --git a/.gitignore b/.gitignore index 894a44c..174b17b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +auth.json +database.db + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/auth.sample.json b/auth.sample.json new file mode 100644 index 0000000..467ec34 --- /dev/null +++ b/auth.sample.json @@ -0,0 +1,4 @@ +{ + "id": "YOUR APP'S CLIENT ID HERE", + "secret": "YOUR APP'S CLIENT SECRET HERE" +} \ No newline at end of file diff --git a/login.py b/login.py new file mode 100644 index 0000000..5f9e1e5 --- /dev/null +++ b/login.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +#Curious Greg - Curious Cat to Mastodon crossposter +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import requests, sqlite3, json, argparse +from mastodon import Mastodon + +db = sqlite3.connect("database.db") +c = db.cursor() + +c.execute("CREATE TABLE IF NOT EXISTS `data` (username VARCHAR NOT NULL, secret VARCHAR NOT NULL, latest_post VARCHAR)") +try: + client_auth = json.load(open("auth.json")) +except Exception: #todo: only handle file not found + print("Couldn't load auth.json, are you sure you created it?") + diff --git a/main.py b/main.py new file mode 100644 index 0000000..e8f1518 --- /dev/null +++ b/main.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +#Curious Greg - Curious Cat to Mastodon crossposter +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import requests, sqlite3, json + +