Skip to content

Content Recommendations

You can use SEOtools for content recommendation.

There are two methods of recommending content:

  1. Automatically adding relevant links to a web page.
  2. Identifying content for a "See Also" (aka "Related Posts") section.

This guide uses the Analyzer() class. Read the fullAnalyzer() documentation for more information.

import markdown

article = markdown.markdown(BeautifulSoup(article.text, "html.parser").get_text())

keyword_replace_count = 0

for keyword, url in keyword_map.items():
    if keyword_replace_count >= MAX_KEYWORD_REPLACE:
        break

    article = article.replace(keyword, f"<a href='{url}'>{keyword}</a>", 1)
    keyword_replace_count += 1

print(article)
article = requests.get("https://jamesg.blog/...")

article = markdown.markdown(BeautifulSoup(article.text, "html.parser").get_text())

urls = analyzer.recommend_related_content(article.text)