#! /usr/bin/env python import pickle from config import Config from dbconfig import engine from log import log from mastodon import Mastodon from models import ( Accounts, Attachments, Base, Hashtags, Posts, ) TESTDATA = "/home/kae/git/urma/hometl.pickle" # Mastodon.create_app( # 'urma', # api_base_url='mastodon.org.uk', # to_file='urma_clientcred.secret' # ) # API_BASE_URL = 'mastodon.org.uk' # mastodon = Mastodon(client_id = 'urma_clientcred.secret',) # mastodon.log_in('kae@midnighthax.com', '^ZUaiC8P6vLV49', # to_file='urma_usercred.secret') # hometl = Mastodon.timeline() # hometl = mastodon.timeline() # hometl # len(hometl) # hometl0=hometl[0] # hometl0 # history # mastodon.me() # following=mastodon.account_following(kaeid) # len(following) # following[0] # following[39] # following._pagination_next # following._pagination_prev # history Base.metadata.create_all(engine) # mastodon = Mastodon(access_token=Config.ACCESS_TOKEN) # Data for development with open(TESTDATA, "rb") as inp: hometl = pickle.load(inp) post = Posts() import ipdb; ipdb.set_trace() # Parse timeline # for post in hometl: # post = Posts()