Better toot formatting with html

This commit is contained in:
Felix Ableitner 2019-09-09 00:17:36 +02:00
parent d85955c2f3
commit aa8bb06cb2

View file

@ -39,6 +39,5 @@ with open('marxistquotes.csv') as csvfile:
csvreader = csv.reader(csvfile, delimiter=',', quotechar='`', skipinitialspace=True)
row = random.choice(list(csvreader))
# TODO: post as markdown or html with link to source
text = '{}\n\n - {}'.format(row[0], row[1])
toot = mastodon_api.status_post(text, visibility='private')
text = '<p>{}</p>&nbsp;&nbsp;&nbsp;&nbsp;- {}<a href={}>{}</a>'.format(row[0], row[1], row[2], row[3])
toot = mastodon_api.status_post(text, visibility='private', content_type='text/html')