8 Commits

Author SHA1 Message Date
Dome 370275b2ca Update README.md 2026-04-21 11:57:21 +02:00
Dome 1bb7b870b2 Merge branch 'main' of https://github.com/Domoel/GTS-Federator 2026-04-21 01:51:14 +02:00
Dome a53501cb84 Update README.md 2026-04-21 01:51:13 +02:00
Dome 29326a549a Update README.md 2026-04-20 10:39:08 +02:00
Dome 2a993a6c43 Update README.md 2026-04-20 10:38:48 +02:00
Dome 332c19b1d3 Update README.md 2026-04-20 10:38:34 +02:00
Dome df7e15dff7 Update gts-federator.py 2026-04-19 20:46:12 +02:00
Dome 001ba6adb6 Update gts-federator.py 2026-04-19 20:32:37 +02:00
2 changed files with 11 additions and 6 deletions
+6 -2
View File
@@ -18,7 +18,7 @@ A powerful RSS-based discovery engine to populate GoToSocial instances.
· ·
<a href="https://ztfr.eu/matrix">📰 Zeitfresser Matrix Community</a> <a href="https://ztfr.eu/matrix">📰 Zeitfresser Matrix Community</a>
· ·
<a href="https://social.ztfr.eu/@dome">🐘 Fediverse</a> <a href="https://social.ztfr.eu/@dome">🐘 Mastodon</a>
· ·
<a href="https://look.ztfr.eu/#/#support:ztfr.eu">💬 Supportchat</a> <a href="https://look.ztfr.eu/#/#support:ztfr.eu">💬 Supportchat</a>
</h6> </h6>
@@ -165,7 +165,11 @@ services:
- .env - .env
restart: always restart: always
``` ```
You can download the docker image on [Docker Hub](https://hub.docker.com/repository/docker/domoel/gts-federator/general) You can download the docker image on [Docker Hub](https://hub.docker.com/r/domoel/gts-federator).
## 🛠 Development & Support
If you need to get support or want to participate in the active development of this software, you can <a href="https://ztfr.eu/matrix">join our Zeitfresser Matrix Community</a> or the <a href="https://look.ztfr.eu/#/#support:ztfr.eu">Development & Support Channel</a> on Matrix.
## 📜 License & Credits ## 📜 License & Credits
+5 -4
View File
@@ -68,7 +68,7 @@ class GTSFederator:
if not os.path.exists(self.config["rss_urls_file"]): if not os.path.exists(self.config["rss_urls_file"]):
self.logger.error("RSS_URLS_FILE missing!") self.logger.error("RSS_URLS_FILE missing!")
return 0, 0 return 0, 0, 0, 0
with open(self.config["rss_urls_file"], 'r', encoding='utf-8') as f: with open(self.config["rss_urls_file"], 'r', encoding='utf-8') as f:
rss_urls = [l.split('#')[0].strip() for l in f if l.strip() and not l.strip().startswith('#')] rss_urls = [l.split('#')[0].strip() for l in f if l.strip() and not l.strip().startswith('#')]
@@ -122,17 +122,18 @@ class GTSFederator:
runtime = str(timedelta(seconds=int(time.time() - start_time))) runtime = str(timedelta(seconds=int(time.time() - start_time)))
print(f"\n✅ Run Completed | Time: {runtime} | New Posts: {total_new} | Instances: {curr} (+{diff})") print(f"\n✅ Run Completed | Time: {runtime} | New Posts: {total_new} | Instances: {curr} (+{diff})")
self.save_state(curr) self.save_state(curr)
self.previous_instances = curr
return total_new, num_feeds return total_new, num_feeds, curr, diff
def run_forever(self): def run_forever(self):
wait_seconds = self.parse_interval(self.config["fetch_interval"]) wait_seconds = self.parse_interval(self.config["fetch_interval"])
self.logger.info(f"GTS-Federator Active. Interval: {self.config['fetch_interval']}") self.logger.info(f"GTS-Federator Active. Interval: {self.config['fetch_interval']}")
while True: while True:
posts, feeds = self.process_feeds() posts, feeds, instances, growth = self.process_feeds()
self.logger.info(f"💤 Run completed. Pausing for {self.config['fetch_interval']}.") self.logger.info(f"💤 Run completed. Pausing for {self.config['fetch_interval']}.")
self.logger.info(f"📊 Fetched {posts} Posts from {feeds} RSS-Feeds") self.logger.info(f"📊 Fetched {posts} Posts from {feeds} RSS-Feeds. Known Instances: {instances} (+{growth})")
next_run = datetime.now() + timedelta(seconds=wait_seconds) next_run = datetime.now() + timedelta(seconds=wait_seconds)
self.logger.info(f"⏰ Next scheduled run: {next_run.strftime('%H:%M:%S')}") self.logger.info(f"⏰ Next scheduled run: {next_run.strftime('%H:%M:%S')}")