Skip to content

Commit b2f7a97

Browse files
AppStore: report installs to BadgeHub API for download statistics
1 parent badccb6 commit b2f7a97

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

docs/apps/badgehub.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The BadgeHub backend uses API version 3:
1616

1717
- `https://badgehub.eu/api/v3/project-summaries` — list of all published projects with summary metadata.
1818
- `https://badgehub.eu/api/v3/projects/<slug>` — full project details, including releases, icons, and descriptions.
19+
- `https://badgehub.eu/api/v3/projects/<slug>/rev<revision>/report/install` — POST to report successful app installation. Includes device MAC and its SHA1 hash as query parameters.
1920

2021
Each project maps to one MicroPythonOS app package. The project's slug becomes the app identifier in the store.
2122

docs/frameworks/download-manager.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,25 @@ except Exception as e:
131131
- Error codes: `-110` (ETIMEDOUT), `-113` (ECONNABORTED), `-104` (ECONNRESET), `-118` (EHOSTUNREACH), `-202` (DNS error)
132132
- Error messages: "connection reset", "connection aborted", "broken pipe", "network unreachable", "host unreachable"
133133

134+
### `DownloadManager.post_url()`
135+
136+
```python
137+
def post_url(url, data=None, headers=None, redact_url=False)
138+
```
139+
140+
**Note:** Works in both async and sync contexts, same as `download_url`.
141+
142+
**Parameters:**
143+
144+
| Parameter | Type | Description |
145+
|-----------|------|-------------|
146+
| `url` | str | URL to POST to (required) |
147+
| `data` | bytes | Request body (optional, default `None` = POST with empty body) |
148+
| `headers` | dict | Custom HTTP headers (optional) |
149+
| `redact_url` | bool | Redact URL from log output (default `False`) |
150+
151+
**Returns:** `bytes` — response body on success, `None` on failure.
152+
134153
### `DownloadManager.get_resume_position(outfile)`
135154

136155
Get the current size of a partially downloaded file.

0 commit comments

Comments
 (0)