Spaces:
Running
Running
Deploy bbcollect 77c91a6182e4f14ba3514991318024822f86e4c3
Browse files- README.md +1 -1
- collector.py +3 -0
README.md
CHANGED
|
@@ -55,7 +55,7 @@ curl -N https://wuhp-bbconnectapi.hf.space/gradio_api/call/collect/EVENT_ID
|
|
| 55 |
|
| 56 |
Program fields: `id`, `platform`, `handle`, `name`, `url`, `website`, `offers_bounties`, `min_bounty`, `max_bounty`, `submission_state`. Unknown values are null. Bounty values retain platform-native currency structures; do not compare currencies without conversion.
|
| 57 |
|
| 58 |
-
Use the exact platform and handle returned by `/collect` for `/scope`. Scope is fetched separately and contains `in_scope` and `out_of_scope` arrays with platform-native fields, instructions and exclusions.
|
| 59 |
|
| 60 |
Each source reports `mode` (`live` or `public_dataset`), `source_url`, `fetched_at`, `source_updated_at` (null if unavailable), and `cached`. Retrieval time is not the time the platform last changed its data. Live pages are fetched sequentially, not atomically; pagination may shift after the cache expires.
|
| 61 |
|
|
|
|
| 55 |
|
| 56 |
Program fields: `id`, `platform`, `handle`, `name`, `url`, `website`, `offers_bounties`, `min_bounty`, `max_bounty`, `submission_state`. Unknown values are null. Bounty values retain platform-native currency structures; do not compare currencies without conversion.
|
| 57 |
|
| 58 |
+
Use the exact platform and handle returned by `/collect` for `/scope`. Intigriti uses its program UUID as the handle because URL slugs can repeat across companies. Scope is fetched separately and contains `in_scope` and `out_of_scope` arrays with platform-native fields, instructions and exclusions.
|
| 59 |
|
| 60 |
Each source reports `mode` (`live` or `public_dataset`), `source_url`, `fetched_at`, `source_updated_at` (null if unavailable), and `cached`. Retrieval time is not the time the platform last changed its data. Live pages are fetched sequentially, not atomically; pagination may shift after the cache expires.
|
| 61 |
|
collector.py
CHANGED
|
@@ -124,6 +124,9 @@ def bounty_value(value):
|
|
| 124 |
def normalize(platform, row):
|
| 125 |
url = row.get("url") or ""
|
| 126 |
handle = str(row.get("handle") or row.get("id") or urlsplit(url).path.rstrip("/").split("/")[-1])
|
|
|
|
|
|
|
|
|
|
| 127 |
if platform == "yeswehack" and not url:
|
| 128 |
url = f"https://yeswehack.com/programs/{handle}"
|
| 129 |
maximum = bounty_value(row.get("max_bounty", row.get("max_payout")))
|
|
|
|
| 124 |
def normalize(platform, row):
|
| 125 |
url = row.get("url") or ""
|
| 126 |
handle = str(row.get("handle") or row.get("id") or urlsplit(url).path.rstrip("/").split("/")[-1])
|
| 127 |
+
# Intigriti handles are unique within a company, not across the platform.
|
| 128 |
+
if platform == "intigriti":
|
| 129 |
+
handle = str(row.get("id") or f"{row.get('company_handle', '')}--{handle}")
|
| 130 |
if platform == "yeswehack" and not url:
|
| 131 |
url = f"https://yeswehack.com/programs/{handle}"
|
| 132 |
maximum = bounty_value(row.get("max_bounty", row.get("max_payout")))
|