Package: hoyolab-rss-feeds
Hoyolab RSS FeedsGenerate RSS news feeds for Hoyoverse games like Genshin Impact or Honkai Starrail based
on the officialHoyolabforum posts. Available feed formats
areAtomandJSON Feed.
This application is supposed to run periodically by a cronjob for example.There are somefeedsalready hosted by myself!InstallationYou need at least Python 3.8 and the package manager Pip installed. You can then
install this package from PyPI with:pipinstallhoyolab-rss-feedsUsageCLIYou can run the application like this:hoyolab-rss-feedsor as module:python-mhoyolabrssfeedsIf no configuration can be found, the application will create a default config
in your current directory (./hoyolab-rss-feeds.toml) and will exit afterward.You can specify a path for the config file with a parameter:hoyolab-rss-feeds-cpath/to/config.tomlModuleIt is also possible to generate the feeds via code:frompathlibimportPathfromhoyolabrssfeedsimportFeedConfigLoader,GameFeed,GameFeedCollection,Gameasyncdefgenerate_feeds():loader=FeedConfigLoader(Path("path/to/config.toml"))# all games in configall_configs=awaitloader.get_all_feed_configs()feed_collection=GameFeedCollection.from_configs(all_configs)awaitfeed_collection.create_feeds()# only a single gamegenshin_config=awaitloader.get_feed_config(Game.GENSHIN)genshin_feed=GameFeed.from_config(genshin_config)awaitgenshin_feed.create_feed()Hereyou can find an example on how to create a feed without using the TOML config file.ConfigurationIn the TOML config file you can define for which games you want to create a feed
and in which format the feeds should be. Here is an example config:language="de-de"category_size=15[genshin]feed.json.path="path/to/genshin.json"feed.json.url="https://example.org/genshin.json"categories=["Info","Notices"]category_size=5title="Genshin Impact News"icon="https://example.org/icon.png"[starrail]feed.json.path="path/to/starrail.json"feed.json.url="https://example.org/starrail.json"feed.atom.path="path/to/starrail.xml"feed.atom.url="https://example.org/starrail.xml"A minimal configuration requires at least one game section with afeed.<format>.pathentry. Available feed formats are currentlyjsonandatom. You can either use
one format or both.Entries defined at root level are considered default values and will apply to every
game section. Thefeedkey can only be used in a game section. All other keys
can be defined at root level, and they can be overwritten by a game section.Thecategorieslist defines the selected Hoyolab categories (Info,EventandNotices) for this feed. If this entry is omitted, all categories are selected.
Thecategory_sizeentry defines the amount of feed items (default: 5) of a category
for each feed.Note:When using Windows file paths (likeC:\\path\to\config.toml), single quotes
should be used to avoid wrong auto-escaping of backslashes. More info about the TOML
format can be found in theofficial documentation.LoggingSimple logs at levelINFOare written to the terminal by default. If a file path is given
via parameter (-l /path/to/out.log), the logs are written to this file.If the application is run via code, the logger must beconfiguredseparately.
The application specific logger is available by:importlogginglogger=logging.getLogger("hoyolabrssfeeds")OptionsGamesGameSectionGenshin ImpactgenshinHonkai Impact 3rdhonkaiTears of ThemisthemisHonkai: StarrailstarrailZenless Zone ZerozenlessLanguagesEnglish is the default language.LanguageCodeGermande-deEnglishen-usSpanishes-esFrenchfr-frIndonesianid-idItalianit-itJapaneseja-jpKoreanko-krPortuguesept-ptRussianru-ruThaith-thTurkishtr-trVietnamesevi-vnChinese (CN)zh-cnChinese (TW)zh-tw