title: Is there a standard library for embedding urls?
date: 2018/03/01 07:44:24
slug: is-there-a-standard-library-for-embedding-urls
status: published
link: https://jj.isgeek.net/2018/03/is-there-a-standard-library-for-embedding-urls/
display_format: entry
syndication: https://twitter.com/jjdelc/status/969116128772526080


Tonight I worked on improving the way that shared links, replies and likes are displayed on the posts. I had to use a mix of an [Opengraph](https://github.com/erikriver/opengraph/) parser and a Microformats parser to read as many attributes as I could to get something to display. 

Sadly, most content out there isn't using microformats [so the guidance](https://indieweb.org/reply-context) doesn't apply all that well. Unsurprisingly most websites do implement the Opengraph standard which provides me with the header information I need.

I find that I'll also have to add a lot of special casing for popular sites and parse them individually, Twitter replies, Youtube and reddit posts come to mind. I am already handling image links, although they are hotlinked which isn't very comforting... 

Next step will be to put all this parsing in an asynchronous task so I can get a copy of the image (which will hopefully allow to be downloaded/scraped).

 . #openweb #indieweb #micropub #python