Skip to content

Commit

Permalink
[nyarlathotep] Unescape htmlentities in rss-to-mastodon
Browse files Browse the repository at this point in the history
  • Loading branch information
barrucadu committed Sep 4, 2024
1 parent 094d179 commit e2b73c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hosts/nyarlathotep/jobs/rss-to-mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import docopt
import feedparser
import html.parser
import http.client
import os
import pathlib
Expand Down Expand Up @@ -63,8 +64,11 @@

# if there are multiple items, post the older ones first
for item in reversed(items):
# handle entities
title = html.parser.unescape(item["title"])

print(item["id"])
print(item["title"])
print(title)
print()

if dry_run:
Expand All @@ -77,7 +81,7 @@
"Idempotency-Key": item["id"],
},
json={
"status": item["title"],
"status": title,
"visibility": visibility,
},
).raise_for_status()
Expand Down

0 comments on commit e2b73c4

Please sign in to comment.