Check this tweet by Chris Johnson: it’s a tweet with a link whose preview image shows the actual number of retweets and likes for said tweet.
A meta tweet.https://t.co/lvaYUszJaE
— Chris Johnson (@defaced) January 25, 2022
Cool!
In a later tweet, Chris shares how it’s done:
How this works!
π·ββοΈ A @Cloudflare worker responds to requests from Twitter with HTML inc. social meta.
π¨ The image in that meta points to a Cloud Function which generates a dynamic image using Puppeteer.
πͺ A scheduled Cloud Function runs some magic to invalidate Twitter's cache.— Chris Johnson (@defaced) January 27, 2022
The image should update every five to ten minutes.