aboutsummaryrefslogtreecommitdiffstats
path: root/python/sandcrawler/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/sandcrawler/db.py')
-rw-r--r--python/sandcrawler/db.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/sandcrawler/db.py b/python/sandcrawler/db.py
index eb1a922..1a47b0b 100644
--- a/python/sandcrawler/db.py
+++ b/python/sandcrawler/db.py
@@ -9,7 +9,7 @@ import requests
class SandcrawlerPostgrestClient:
def __init__(self, api_url="http://aitio.us.archive.org:3030", **kwargs):
- self.api_uri = api_url
+ self.api_url = api_url
def get_cdx(self, url):
resp = requests.get(self.api_url + "/cdx", params=dict(url='eq.'+url))
@@ -34,6 +34,15 @@ class SandcrawlerPostgrestClient:
else:
return None
+ def get_ingest_file_result(self, url):
+ resp = requests.get(self.api_url + "/ingest_file_result", params=dict(base_url='eq.'+url))
+ resp.raise_for_status()
+ resp = resp.json()
+ if resp:
+ return resp[0]
+ else:
+ return None
+
class SandcrawlerPostgresClient:
def __init__(self, db_url, **kwargs):