Commit 8859522e authored by Stefan Karner's avatar Stefan Karner

Add utility functions to parse full text search responses

parent 732a122c
......@@ -305,7 +305,21 @@ class WebarchivSession:
print('Error:'.format(query_string))
def getSnapshotUrl(self, seed, capture, onlysvg):
return self.api_path + 'snapshot?capture=' + capture + '&t=' + self.token + '&apikey=' + self.api_key + '&onlysvg=' + onlysvg + '&seed=' + seed;
return self.api_path + 'snapshot?capture=' + capture + '&t=' + self.token + '&apikey=' + self.api_key + '&onlysvg=' + onlysvg + '&seed=' + seed
@staticmethod
def resultContainsSeeds(response):
try:
return response.json()['subtype'] == 2
except:
return False
@staticmethod
def resultContainsCaptures(response):
try:
return response.json()['subtype'] == 3
except:
return False
def savePage(self, url):
self.connect()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment