Changed getDescription() to limit description string length

Now it will print at most 100 characters, though at some point
I might add something to break the string at the end of a sentence.
This commit is contained in:
A.M. Rowsell 2025-01-31 16:16:27 -05:00
parent 38e78bcdf4
commit e6c43876ac
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -23,9 +23,11 @@ log_file_name = r"/app.log"
def getDescription(feed):
try:
desc = str(feed.entries[0]["summary_detail"]["value"])
tempStr = str(feed.entries[0]["summary_detail"]["value"])
desc = tempStr[:100] if len(tempStr) > 100 else tempStr
except KeyError:
desc = str(feed.entries[0]["description"])
tempStr = str(feed.entries[0]["description"])
desc = tempStr[:100] if len(tempStr) > 100 else tempStr
return desc