Skip to content

Commit

Permalink
Fixed pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Pdzly committed Jul 27, 2024
1 parent 97f8bb2 commit f59c9bb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fedi_gatus/config_gen/gen.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import math

import requests
import yaml

# import math
# from fedi_gatus.shared import db
from fedi_gatus.shared import db


class Endpoint:
Expand Down Expand Up @@ -65,9 +65,9 @@ def generate_top_instances():
import os

logging.info("Get top instances")
# from pythonseer import Fediseer
from pythonseer import Fediseer

# f = Fediseer()
f = Fediseer()
# fediseer_data = f.whitelist.get(guarantors=3, endorsements=4)['instances']
# TODO Ask dbo about adding params to library
# https://github.com/Fediseer/pythonseer/issues/7
Expand All @@ -76,6 +76,7 @@ def generate_top_instances():

d = []
i = 0
page = 1
while True:
if i >= int(os.getenv("NUMBER_OF_SERVERS")):
break
Expand All @@ -89,9 +90,11 @@ def generate_top_instances():
"guarantors": 1,
"software_csv": "lemmy",
"limit": next,
"page": page,
"domains": True,
},
)
page += 1

if response.status_code == 200:
d += response.json()["domains"]
Expand Down

0 comments on commit f59c9bb

Please sign in to comment.