from ConfigParser import ConfigParser
from golemUtils import breakUp
from WPAW import Wrapper
from time import sleep
from tinydb import import TinyDB, where

db = TinyDB('db.json')

badWords = db.table('badWords')
badPhrases2 = db.table('badPhrases2')
badPhrases3 = db.table('badPhrases3')

goodWords = db.table('goodWords')
goodPhrases2 = db.table('goodPhrases2')
goodPhrases3 = db.table('goodPhrases3')


config = ConfigParser()
config.readfp(open('config.ini'))

golem = Wrapper(user_agent="Clay Golem")

golem.token =  config.get('Default','api_key')

done = []

while True:
    words = []
    phrase_2 = []
    phrase_3 = []

    golem.get_posts()

    posts = golem.posts

    for post in posts:
        if post not in done:
            words, phrase_2, phrase_3 = break_up(post["content"])
