Comparar commits

..

No hay commits en común. '64cc856b41c4428e057f24090c7f948cbb7585f4' y '26c78f20f7b22d4933ebe2ba2e653e6b8fb03bf1' tienen historias completamente diferentes.

S'han modificat 2 arxius amb 10 adicions i 14 eliminacions

Veure arxiu

@ -59,7 +59,7 @@ if __name__ == '__main__':
i = 0
while i < len(soft_total_project):
while i < 5:
db.write_top_soft(soft_total_project[i], soft_total_users[i], soft_total_mau[i], soft_total_servers[i])

Veure arxiu

@ -13,9 +13,9 @@ def date_string():
month = '{:02d}'.format(now.month)
year = str(now.year)
year = str(now.year)[2:]
return day, month, year
return f'{year}{month}{day}'
if __name__ == '__main__':
@ -25,19 +25,15 @@ if __name__ == '__main__':
os.makedirs('dataset')
day, month, year = date_string()
date = date_string()
if not os.path.exists(f'dataset/{year}'):
if not os.path.exists(f'dataset/{date}'):
os.makedirs(f'dataset/{year}')
os.makedirs(f'dataset/{date}')
if not os.path.exists(f'dataset/{year}/{month}'):
filename = f'dataset_{date}.csv'
os.makedirs(f'dataset/{year}/{month}')
filename = f'dataset_{year}{month}{day}.csv'
db.csv_save(f'dataset/{year}/{month}/{filename}')
db.csv_save(f'dataset/{date}/{filename}')
fgj = Forgejo()
@ -45,11 +41,11 @@ if __name__ == '__main__':
try:
with open(f'dataset/{year}/{month}/{filename}', 'rb') as input_file:
with open(f'dataset/{date}/{filename}', 'rb') as input_file:
data = input_file.read()
file = base64.b64encode(data)
response = fgj.repo_owner_create_file(gituser.login, fgj.stats_repo, f'dataset/{year}/{month}/{filename}', gituser.email, gituser.login, "main", file, f"{year}{month}{day} fediverse's dataset")
response = fgj.repo_owner_create_file(gituser.login, fgj.stats_repo, f'dataset/{date}/{filename}', gituser.email, gituser.login, "main", file, f"{date} fediverse's dataset")
if 'content' in response: