zedeus / nitter

Alternative Twitter front-end
https://nitter.net
GNU Affero General Public License v3.0
9.74k stars 516 forks source link

titles in RSS feed became too long after the 2023 massive increase in character limit #1113

Open nvalexander opened 7 months ago

nvalexander commented 7 months ago

With the introduction of longer than 140 character posts, it may be the time to distinguish between title and description in the Atom feed. Currently, a thousand-character post leads, in Nitter, to a thousand-character title, which is not suitable for summary views.

nvalexander commented 7 months ago

I do not have the a way to test this, but I believe a quick fix is to insert in nitter/src/views/rss.nimf, after the line

#result &= xmltree.escape(text)

the following:

#var maxLength = 130
#if result.len > maxLength:
#  var cutoff = maxLength
#  while cutoff > 0 and result[cutoff] notin {' ', '\n', '\t'}:
#    dec(cutoff)
#  if cutoff == 0:
#    while cutoff < result.len and result[cutoff] notin {' ', '\n', '\t'}:
#      inc(cutoff)
#  result = result[0..cutoff-1]
#
zedeus commented 7 months ago

I agree, and these very long posts definitely need to be trimmed, but it's not as simple as that. See #493 for an old related discussion.

nvalexander commented 7 months ago

Previously, users wanted to see the full post in the title, because they wanted to read the whole post from smartphone alerts. I don't think 10,000 characters, or whatever is the current limit, would still fit in the alert. In fact, I started this issue when my computer screen ran out of space.

Even a maxLength of 1000 would be better for me, when compared to the current setup.

Philippe-Choquette commented 6 months ago

I personally prefer the way that Mastodon integrated RSS. They don't include the "title" element in the articles and only make use of the "description", so you don't end up with a duplicate of the post in your RSS reader.