```pythonimport random# Generate random content for the
articledef generate
_content(min_words, max_words):
content = ""
word_count = random
.randint(min_words, max_words)
for _ in range(word_count):
content += "Lorem ipsum "
return
content# Generate random tags based on the article
content and titledef generate_tags(title, content):
tags = set()
words = title.split() + content.split()
while len(tags) 2: # Filter out short words tags.add(tag)
return tags
# Main function to generate the article and tagsdef generate_article():
title = "
标题
"
content = generate_content(1000, 3000)
tags = generate_tags(title, content)
# Format the tags as a comma-separated string tags_str = ", ".join(tags)
# Remove HTML tags from the tags string tags_str = ''.join(c for c in tags_str if c.isalnum() or c in [',', ' '])
return title + content, tags_str# Generate the article and tagsarticle, tags = generate
_article()
print(article)
print(tags)
本文链接:http://eherun.com/post/9.html
```