Spaces:
Sleeping
Sleeping
Delete fbi_vault_live.py
Browse files- fbi_vault_live.py +0 -20
fbi_vault_live.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
| 1 |
-
import httpx
|
| 2 |
-
from ingest.generic_public_foia import GenericFOIAAdapter
|
| 3 |
-
|
| 4 |
-
class FBIAdapter(GenericFOIAAdapter):
|
| 5 |
-
name = "FBI Vault"
|
| 6 |
-
rate_limit = 1
|
| 7 |
-
robots_respected = True
|
| 8 |
-
base_url = "https://vault.fbi.gov/search"
|
| 9 |
-
|
| 10 |
-
async def search(self, query: str):
|
| 11 |
-
async with httpx.AsyncClient(timeout=10) as client:
|
| 12 |
-
r = await client.get(self.base_url, params={"q": query})
|
| 13 |
-
if r.status_code != 200:
|
| 14 |
-
return []
|
| 15 |
-
return [{
|
| 16 |
-
"source": "FBI Vault",
|
| 17 |
-
"query": query,
|
| 18 |
-
"url": str(r.url),
|
| 19 |
-
"snippet": "Public FBI Vault search results"
|
| 20 |
-
}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|