This is the code I use to generate my Tweets page

As of September 2021 it seems to have broken and will need to be retooled along the lines of my archive my tweets project.

import twint
import nest_asyncio

c = twint.Config()

c.Username = 'deepfates'
c.Popular_tweets = True
# c.Limit = 1
c.Min_likes = 130
tweets = []
c.Store_object = True
c.Store_object_tweets_list = tweets
tweets.sort(key=lambda x: x.datetime, reverse=True)
from datetime import date

today =
def get_include(link):
    return('{% include twitter.html '+f'''content='<a href="{link}">{link}</a>' '''+'%}')

def get_md(includes):
layout: page
title: Tweets
permalink: /tweets/

I post a lot of tweets.


Here are some of my recent popular posts (not my most popular posts, which I tend to delete when they make me anxious)\n. Last updated {today}
includes = '\n\n'.join([get_include( for t in tweets])
md = get_md(includes)
with open('../_pages/', 'w') as f:
    print(md, file=f)