curious-greg/run.py

21 lines
617 B
Python
Executable File

#!/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 json, time
from mastodon import Mastodon
import requests
import mysql.connector
cfg = json.load(open('meta.json'))
db = mysql.connector.connect(user=cfg['dbuser'], password=cfg['dbpass'], database=cfg['dbname'])
c = db.cursor()
dc = db.cursor(dictionary=True)
dc.execute("SELECT * FROM data")
for row in dc.fetchall():
print(row)