def createPost(): ''' Create posts from facts fetched and sanitized to remove unwanted characters ''' facts = sanitizeFacts() agent = createClient() blog = "tumblr blog name" for id, content in facts.iteritems(): agent.create_text(blog, state="queue", body= content +"\n "+ id, tags=['facts', 'TIL', 'todayilearned'],)
def facts(posts=None): return render_template('facts.html', posts=sanitizeFacts(), title = 'index')