create files, table, config, etc
This commit is contained in:
parent
669144577c
commit
3d03569107
4 changed files with 34 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
||||||
|
auth.json
|
||||||
|
database.db
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|
4
auth.sample.json
Normal file
4
auth.sample.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"id": "YOUR APP'S CLIENT ID HERE",
|
||||||
|
"secret": "YOUR APP'S CLIENT SECRET HERE"
|
||||||
|
}
|
18
login.py
Normal file
18
login.py
Normal file
|
@ -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?")
|
||||||
|
|
9
main.py
Normal file
9
main.py
Normal file
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue