curious-greg/run.py

21 lines
617 B
Python
Raw Normal View History

#!/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/.
2018-11-13 02:49:23 +00:00
import json, time
from mastodon import Mastodon
2018-11-13 02:49:23 +00:00
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)