Spaces:
Sleeping
Sleeping
Download analytics.py from Prosync/pre-aprobador-docs-SERCOL: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/Prosync/pre-aprobador-docs-SERCOL/resolve/main/analytics.py
- Command line
-
hf download hf://spaces/Prosync/pre-aprobador-docs-SERCOL/analytics.py
-
curl -L -o analytics.py https://huggingface.co/spaces/Prosync/pre-aprobador-docs-SERCOL/resolve/main/analytics.py
612 Bytes
| import requests | |
| import json | |
| def enviar_evento(email, evento): | |
| headers = { | |
| 'Content-Type': 'application/json', | |
| 'Accept': '*/*' | |
| } | |
| data = { | |
| "api_key": "f80efefa371aab8b7cde391020d33ed1", | |
| "events": [{ | |
| "device_id": email, | |
| "event_type": evento | |
| }] | |
| } | |
| response = requests.post('https://api2.amplitude.com/2/httpapi', | |
| headers=headers, data=json.dumps(data)) | |
| if response.status_code == 200: | |
| print("Success:", response.json()) | |
| else: | |
| print("Error:", response.text) |