synzen / MonitoRSS

MonitoRSS RSS bot (formerly known as Discord.RSS) with customizable feeds. https://monitorss.xyz
https://monitorss.xyz
MIT License
1.05k stars 237 forks source link

A way to shorten values #330

Closed dt192 closed 11 months ago

dt192 commented 12 months ago

It would be good if there were some options to shorten values, as description for example can be quite long.

It would be nice to have some options such as max length (in chars) and maybe a regex option to split at. This sort of thing maybe {{description}, maxLength:250} or {{description}, split:/^(.*)\n{2}/s}

You currently have the Split Content option, but that only splits the whole message when it's longer than discord's limit, so is not helpful for this.

synzen commented 11 months ago

Placeholder limits should now be implemented for personal feeds on the public bot. If you are inquiring about legacy feeds however, feature development on them has stopped in favor of the transition to personal feeds. For more information on the transition, please see the news channel in the Discord support server: https://discord.gg/kRjevzXhss

Feel free to reply if you have any more questions

dt192 commented 11 months ago

@synzen Thanks, that's a nice implementation.

It does appear to have a bug though (or I'm doing it wrong)

This is with a limit of 250 with ... appended 2023-07-17_16-08

This is with a limit of 275 with ... appended, Same with 300. I'm expecting to see more text not less. 2023-07-17_16-09

These screenshots are just from the preview, so might be working fine live, I'd need to wait for a post to find out.

This is the rss:

<media:description>With the Brawler class in beta for the Lord of the Rings Online, I have a new series on learning the class. In part 2, we will take a deeper dive into the red line DPS spec, The Maelstrom, for the upcoming class in LOTRO! Future videos will go over the other specs and updated gameplay as we get closer to release before Gundabad! Learning Brawler Playlist: https://bit.ly/LearningBrawler Brawler Gameplay & First Impressions: https://youtu.be/dyfOuZNfpNY Stream with a live look at my first time with the Brawler: https://youtu.be/dyfOuZNfpNY Playlist for LOTRO Commentaries: https://goo.gl/R2PnRe Subscribe: http://goo.gl/I829hO Become a member: http://bit.ly/louey7-member Twitter: https://twitter.com/Louey_7 Discord: https://discord.gg/eRk7W4C Website: https://lotrobasics.com/ Timestamps: 00:00 - Intro & Overview 00:49 - Speccing into Red 01:32 - Pummel 03:20 - Red Line Traits 19:49 - Gameplay 22:35 - Traits & Set Bonuses 31:27 - Innate Strength Mechanics 35:49 - Gameplay Roundup 40:29 - Summary and Conclusions End screen music is in-game music from the Midsummer Minas Tirith zone. #LOTRO #Brawler #Gundabad</media:description>
synzen commented 11 months ago

Unfortunately, a slightly larger limit does not necessarily mean more characters will be included. It will depend on a number of factors like how many new lines there are, what punctuation it sees, and how long each "part" is after it splits on the aforementioned factors. You may have to steadily increase the limit until it looks satisfactory

But I've slightly adjusted the splitting to take into account more punctuation like ? and ! - please try again now to see if it satisfies your requirements

For the record, you may also send it directly to Discord using the Send Article button found on any given connection page:

image

to see the actual message (text splitting/limits should be 100% accurate - it's Discord-specific message formatting that are sometimes inaccurate)