{html.escape(title)}
{html.escape(description)}
"""
request = urllib.request.Request(
"https://thumb.im/apis/render/",
data=json.dumps({"html": markup, "width": 1200, "height": 630}).encode(),
headers={"X-API-Key": os.environ["THUMB_IM_API_KEY"], "Content-Type": "application/json"},
)
with urllib.request.urlopen(request) as response:
return json.load(response)["image_url"]
```
Then emit the tags, with the same URL in both `og:image` and `twitter:image`:
```html