Amelia-chan / Amelia

A ScribbleHub-focused RSS bot built in Javacord.
https://discord.com/api/oauth2/authorize?client_id=786464598835986483&permissions=139653925952&scope=bot%20applications.commands
6 stars 3 forks source link

[Enhancement] Split RSS "Title" tag in Story name and chapter name #29

Open Naheulf opened 1 year ago

Naheulf commented 1 year ago

Idea: Split the RSS "title" in two parts (story title and chapter title) to enhance the message format.

Let's take an item in a RSS feed:

<item>
    <title>Markets and Multiverses (A Serial Transmigration LitRPG): Chapter 91: Echoes of the Deep</title>
    <description>N/A</description>
    <link>https://www.scribblehub.com/read/626709-markets-and-multiverses-a-serial-transmigration-litrpg/chapter/788202/</link>
    <category>Markets and Multiverses (A Serial Transmigration LitRPG)</category>
    <category>626709</category>
    <pubDate>Thu, 22 Jun 2023 05:38:34 +0000</pubDate>
</item>

The current update message format is:

"\uD83D\uDCD6 **${item.title} by $author**\n" +
"${item.link}\n" +
"\n\n" +
subscribed

Given the previous RSS item and format, Amelia generate this output: 📖 Markets and Multiverses (A Serial Transmigration LitRPG): Chapter 91: Echoes of the Deep by acaswell
https://www.scribblehub.com/read/626709-markets-and-multiverses-a-serial-transmigration-litrpg/chapter/788202/ @Demo MaM

However, If you look at the RSS item's first "category" tag, the content IS the story title. That why I think we can remove it from the RSS title to get the chapter title.

That way the message format may became:

"\uD83D\uDCD6 **${item.title}** by **$author**\n" +
"${item.chapter}\n" +
"${item.link}\n" +
subscribed

and the formatted message: 📖 Markets and Multiverses (A Serial Transmigration LitRPG) by acaswell
Chapter 91: Echoes of the Deep
https://www.scribblehub.com/read/626709-markets-and-multiverses-a-serial-transmigration-litrpg/chapter/788202/ @Demo MaM

Note: I also removed the blank lines as I suggested in #26

ShindouMihou commented 1 year ago

I think the preferred solution to this would be to use the message format feature which I had to remove in the past since the usage over two years was literally zero. I'll look into adding it again in my free time.