print("Please specify the accounts you'd like Twitter Image Poster to learn from. Enter one account at a time formatted as '@user', followed by a blank line.")
i=None
accounts=[]
whilei!="":
i=input("User: ")
ifnotre.match("@(\w){1,15}$",i):
print("Invalid username")
continue
ifi==""andlen(accounts)==0:
print("You must enter at least one account")
continue
print("Checking account...")
print(api.GetUser(screen_name=i))
# connect to database
db=sqlite3.connect("tip.db")
db.text_factory=str
c=db.cursor()
c.execute("CREATE TABLE IF NOT EXISTS `images` (post_id INT NOT NULL UNIQUE PRIMARY KEY, user_id INT NOT NULL, image_url VARCHAR) WITHOUT ROWID")
db.commit()
last_tweet=c.execute("SELECT post_id FROM `images` WHERE user_id LIKE ? ORDER BY post_id DESC LIMIT 1",(f.id,)).fetchone()