RSS feed generator for official game news from Hoyolab.
Project description
Hoyolab RSS Feeds
Generate RSS news feeds for Hoyoverse games like Genshin Impact or Honkai Starrail based on the official Hoyolab forum posts. Available feed formats are Atom and JSON Feed. This application is supposed to run periodically by a cronjob for example.
There are some feeds already hosted by myself!
Installation
You need at least Python 3.10 and the package manager Pip installed. You can then install this package from PyPI with:
pip install hoyolab-rss-feeds
Usage
CLI
You can run the application like this:
hoyolab-rss-feeds
or as module:
python -m hoyolabrssfeeds
If 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 -c path/to/config.toml
Module
It is also possible to generate the feeds via code:
from pathlib import Path
from hoyolabrssfeeds import FeedConfigLoader, GameFeed, GameFeedCollection, Game
async def generate_feeds():
loader = FeedConfigLoader(Path("path/to/config.toml"))
# all games in config
all_configs = await loader.get_all_feed_configs()
feed_collection = GameFeedCollection.from_configs(all_configs)
await feed_collection.create_feeds()
# only a single game
genshin_config = await loader.get_feed_config(Game.GENSHIN)
genshin_feed = GameFeed.from_config(genshin_config)
await genshin_feed.create_feed()
Here you can find an example on how to create a feed without using the TOML config file.
Configuration
In 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 = 5
title = "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 a feed.<format>.path
entry. Available feed formats are currently json and atom. You can either use
one format or both.
Entries defined at root level are considered default values and will apply to every
game section. The feed key 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.
The categories list defines the selected Hoyolab categories (Info, Event and
Notices) for this feed. If this entry is omitted, all categories are selected.
The category_size entry defines the amount of feed items (default: 5) of a category
for each feed.
Note: When using Windows file paths (like C:\\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 the official documentation.
Logging
Simple logs at level INFO are 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 be configured separately. The application specific logger is available by:
import logging
logger = logging.getLogger("hoyolabrssfeeds")
Options
Games
| Game | Section |
|---|---|
| Genshin Impact | genshin |
| Honkai Impact 3rd | honkai |
| Tears of Themis | themis |
| Honkai: Starrail | starrail |
| Zenless Zone Zero | zenless |
| Honkai: Nexus Anima | nexus |
Languages
English is the default language.
| Language | Code |
|---|---|
| German | de-de |
| English | en-us |
| Spanish | es-es |
| French | fr-fr |
| Indonesian | id-id |
| Italian | it-it |
| Japanese | ja-jp |
| Korean | ko-kr |
| Portuguese | pt-pt |
| Russian | ru-ru |
| Thai | th-th |
| Turkish | tr-tr |
| Vietnamese | vi-vn |
| Chinese (CN) | zh-cn |
| Chinese (TW) | zh-tw |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hoyolab_rss_feeds-2.5.0.tar.gz.
File metadata
- Download URL: hoyolab_rss_feeds-2.5.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42cb5abd04095f1979c69ce45e71bedceded7dadd0afdebe42c0ef62b694f346
|
|
| MD5 |
8e5210ddd4ac9ba39e83125c131fa904
|
|
| BLAKE2b-256 |
3cfa9b8b91ed1b5d75b448f7848c878d39c63b1b1beaf7028f86a16ebd508e54
|
Provenance
The following attestation bundles were made for hoyolab_rss_feeds-2.5.0.tar.gz:
Publisher:
release.yaml on c3kay/hoyolab-rss-feeds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hoyolab_rss_feeds-2.5.0.tar.gz -
Subject digest:
42cb5abd04095f1979c69ce45e71bedceded7dadd0afdebe42c0ef62b694f346 - Sigstore transparency entry: 515699204
- Sigstore integration time:
-
Permalink:
c3kay/hoyolab-rss-feeds@c853213280254771d7948f07fd03c77bc539f289 -
Branch / Tag:
refs/tags/v2.5.0 - Owner: https://github.com/c3kay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c853213280254771d7948f07fd03c77bc539f289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hoyolab_rss_feeds-2.5.0-py3-none-any.whl.
File metadata
- Download URL: hoyolab_rss_feeds-2.5.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d70d3360ae280a7ad0ed1a052933618eba39927d0e34c53d1ce287845e2a222
|
|
| MD5 |
3fdfca85187f9e7212d23f0cbd91b66d
|
|
| BLAKE2b-256 |
7344507d28d6d809357b73e5f2255e9710fed502a92031f806c3d296bc71f506
|
Provenance
The following attestation bundles were made for hoyolab_rss_feeds-2.5.0-py3-none-any.whl:
Publisher:
release.yaml on c3kay/hoyolab-rss-feeds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hoyolab_rss_feeds-2.5.0-py3-none-any.whl -
Subject digest:
4d70d3360ae280a7ad0ed1a052933618eba39927d0e34c53d1ce287845e2a222 - Sigstore transparency entry: 515699213
- Sigstore integration time:
-
Permalink:
c3kay/hoyolab-rss-feeds@c853213280254771d7948f07fd03c77bc539f289 -
Branch / Tag:
refs/tags/v2.5.0 - Owner: https://github.com/c3kay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c853213280254771d7948f07fd03c77bc539f289 -
Trigger Event:
push
-
Statement type: