Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 370275b2ca | |||
| 1bb7b870b2 | |||
| a53501cb84 | |||
| 29326a549a | |||
| 2a993a6c43 | |||
| 332c19b1d3 | |||
| df7e15dff7 | |||
| 001ba6adb6 |
@@ -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
@@ -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')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user