def format_content(article):
  """
  This function takes an Intercom article and formats its content
  as the HTML we'll use for the Guru card. Because Intercom has some
  extra fields on its articles, like the # of views, conversations, and
  counts of user reactions and we don't have these fields in Guru, we
  display these values in the card's HTML.
  """
  url = "https://app.intercom.com/a/apps/%s/articles/articles/%s/show/stats?conversations=true" % (
    article.get("workspace_id"),
    article.get("id")
  )
  views_url = url + "&displaying=views"
  conversations_url = url + "&displaying=newchat"
  reactions_url = url + "&displaying=reacted"

  stats = article.get("statistics") or {}

  banner = """
    <hr />
    <p>
      <a target="_blank" rel="noopener noreferrer" href="%s">%s View%s</a>
      <a target="_blank" rel="noopener noreferrer" href="%s">%s Conversation%s</a>
      <a target="_blank" rel="noopener noreferrer" href="%s">%s Reaction%s</a>: 😃 %s%% &nbsp;😐 %s%% &nbsp;😞 %s%%</p>
  """ % (
    views_url,
    stats.get("views", 0),
    "" if stats.get("views") == 1 else "s",
    conversations_url,
    stats.get("conversations", 0),
    "" if stats.get("conversations") == 1 else "s",
    reactions_url,
    stats.get("reactions", 0),
    "" if stats.get("reactions") == 1 else "s",
    stats.get("happy_reaction_percentage", 0),
    stats.get("neutral_reaction_percentage", 0),
    stats.get("sad_reaction_percentage", 0)
  )
  return article.get("body") + banner