• 0 Posts
  • 3 Comments
Joined 3 years ago
cake
Cake day: August 22nd, 2023

help-circle
  • If it helps there’s a standalone version of the logic.

    At a rough scan, it looks like it tries to find a best guess “main content” node by stripping unlikely nodes and then scoring each node. Element type and content contribute to the score

    /**
           * Loop through all paragraphs, and assign a score to them based on how content-y they look.
           * Then add their score to their parent node.
           *
           * A score is determined by things like number of commas, class names, etc. Maybe eventually link density.
           **/