Creating a site preview like in slack (using aiohttp)

In this article we will write a small library for creating a preview for a site. The description of how the preview works in slack you can check here.

4 Data sources will be used:

  1. oEmbed
  2. Twitter Cards
  3. Open Graph
  4. HTML meta tags

In this exact order we will try to retrieve the data.

Technology stack

For parsing we will use:

Beautiful Soup — to navigate and search through the tree of an HTML document.

html5lib — to parse HTML documents, most correctly works with an invalid HTML markup.

aiohttp — an asynchronous client for receiving web pages + an asynchronous server.

Continue reading article here: Creating a site preview like in slack

Like what you read? Give Vladimir Sidorenko a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.