simonwillisonblog
simonwillisonblog copied to clipboard
Import TILs as blogmarks
Having a separate https://til.simonwillison.net/ blog for TILs means I have content that isn't represented in my main blog (aside from when I link to them in my weeknotes).
I want to automatically populate a blogmark for each TIL. I can use a similar approach to this one for that: https://github.com/simonw/simonwillisonblog/blob/main/blog/management/commands/import_blog_json.py
I wrote about that here: https://simonwillison.net/2017/Nov/4/import-refs/
It already has the ability to import blogmarks: https://github.com/simonw/simonwillisonblog/blob/f0caa71a409890272d6834bdd47888b6c83c4a96/blog/management/commands/import_blog_json.py#L72-L83
And import_ref can be used to avoid importing the same thing twice: https://github.com/simonw/simonwillisonblog/blob/f0caa71a409890272d6834bdd47888b6c83c4a96/blog/management/commands/import_blog_json.py#L86-L89
So... I could teach it to pull a feed from https://til.simonwillison.net/ in response to a POST to some endpoint.
Example JSON: https://gist.github.com/simonw/857572d9b36cd1e791c730790ed489ef
Five of my blogmarks are already to TILs: https://simonwillison.net/dashboard/?sql=select+%2A+from+blog_blogmark+where+link_url+like+%27https%3A%2F%2Ftil.simonwillison.net%25%25%27%3AA14XB8ah9tdq44NaEbKMaLFU3Q7RYbfOm3ZBoEh_iKU - I could update these in the Django admin with the expected import_ref to avoid creating duplicates.
One catch: what should the link description be?
A few options:
- Take the first paragraph of the TIL, with tags stripped - like on https://til.simonwillison.net/datasette
- Go back through all 324 existing TILs and add a short summary to each one
- The fun one: get GPT-3 to create summaries for everything and then manually write summaries going forward