Skip to content

Замінити API лінк на сервіс тривог #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Vadimkin opened this issue Jan 28, 2023 · 1 comment
Closed

Замінити API лінк на сервіс тривог #3

Vadimkin opened this issue Jan 28, 2023 · 1 comment

Comments

@Vadimkin
Copy link

Привіт!

Якщо все ще використовуєте API повітряних тривог, то замініть, будь ласка, https://emapa.fra1.cdn.digitaloceanspaces.com/statuses.jsonhttps://vadimklimenko.com/map/statuses.json, там повністю відповідь 1-в-1. Приблизно через тиждень я перестану оновлювати файл на DO Spaces (перший лінк).

Дякую!

def main(outfile):
data = requests.get('https://emapa.fra1.cdn.digitaloceanspaces.com/statuses.json').json()
mapping = {name: list(state['districts']) for name, state in data['states'].items()}
print(mapping)
with open(outfile, 'w') as fobj:
fobj.write(json.dumps(mapping, indent=4))

@curiousartem
Copy link

Створив Pull Request
#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants