Procházet zdrojové kódy

switch from piboy to raylu's stats URLs

raylu před 1 týdnem
rodič
revize
fa8c1a85f0
3 změnil soubory, kde provedl 4 přidání a 5 odebrání
  1. 1 1
      company.py
  2. 2 3
      integration.py
  3. 1 1
      mat_competitors.py

+ 1 - 1
company.py

@@ -89,7 +89,7 @@ class PlanetCOGC(typing.TypedDict):
 
 class Building(typing.TypedDict):
 	Recipes: typing.Sequence[BuildingRecipe]
-	Expertise: str
+	Expertise: Expertise
 
 class BuildingRecipe(typing.TypedDict):
 	Outputs: typing.Sequence[BuildingMat]

+ 2 - 3
integration.py

@@ -64,8 +64,7 @@ def main() -> None:
 		print(f'{output_mat:3}: {total:8,.0f}{alt}')
 
 def pmmg_monthly_report() -> dict[str, dict[str, CompanyOutput]]:
-	report_constants = cache.get(
-			'https://raw.githubusercontent.com/PMMG-Products/pmmg-products.github.io/main/reports/src/staticData/constants.ts',
+	report_constants = cache.get('https://git.raylu.net/raylu/prunstats/raw/main/src/staticData/constants.ts',
 			json=False, expiry=cache.ONE_DAY)
 	# export const months = ["mar25", "apr25", ..., "dec25", "jan26"];
 	match = re.search(r'export const months = \[(.*?)\];', report_constants)
@@ -74,7 +73,7 @@ def pmmg_monthly_report() -> dict[str, dict[str, CompanyOutput]]:
 	months = [m.strip().strip('"') for m in months_str.split(',')]
 	last_month = months[-1]
 	print('getting report for', last_month)
-	return cache.get(f'https://pmmg-products.github.io/reports/data/company-data-{last_month}.json', expiry=cache.ONE_DAY)['individual']
+	return cache.get(f'https://prun.raylu.net/stats/data/company-data-{last_month}.json', expiry=cache.ONE_DAY)['individual']
 
 class CompanyOutput(typing.TypedDict):
 	amount: int

+ 1 - 1
mat_competitors.py

@@ -40,7 +40,7 @@ def main() -> None:
 			coid_bases[base['OwnerId']].append(planet_id)
 
 	coid_users: dict[str, str] = {company_id: d['Username']
-		for company_id, d in cache.get('https://pmmg-products.github.io/reports/data/knownCompanies.json', expiry=cache.ONE_DAY).items()}
+		for company_id, d in cache.get('https://prun.raylu.net/stats/data/knownCompanies.json', expiry=cache.ONE_DAY).items()}
 
 	competitors: list[Competitor] = []
 	for company_id, co_production in integration.pmmg_monthly_report().items():