Incidentally, if you're on a platform where you can reasonably install cohost.py and you can responsibly vet an internet rando's python3 script before running it on your machine, you can use this to dump the text of all posts from a specific Cohost page of yours to individual files in the current working directory, named in the pattern postID_whenposted.md
I have made Choices in order to preserve some out-of-band information: post headline, CWs, and tags. I make no attempt to retrieve anything except text; archiving posted images is outside my use case.
#!/usr/bin/python3
from pathlib import Path
from cohost.models.user import User
from cohost.models.post import Post
from sys import exit
cookie = '' # copy-paste from web browser devtools as per https://github.com/valknight/Cohost.py#retrieving-your-cookie
projectName = 'caffeinatedOtter' # or whatever your @pagename is
try:
user = User.loginWithCookie(cookie)
project = user.getProject(projectName)
except:
exit('Cohost login failed!')
here = Path.cwd()
page = 0
while True:
postlist = project.getPosts(page)
if len(postlist) > 0:
page = page + 1
for post in postlist:
md = post.plainTextBody
if len(post.contentWarnings) > 0:
cwList = '\n'.join(post.contentWarnings)
md = f"<!-- CWs:\n{cwList}\n-->\n{md}"
if len(post.tags) > 0:
tagList = '\n'.join(post.tags)
md = f"<!-- tags:\n{tagList}\n-->\n{md}"
if len(post.headline) > 0:
md = f"# {post.headline} <!-- Cohost headline -->\n\n{md}"
if len(md) > 0:
filename = here / f"{post.postId}_{post.publishedAt}.md"
filename.write_text(md)
else:
print('Done.')
exit(0)