diff --git a/app/getannot.py b/app/getannot.py
index c24b522..895200a 100644
--- a/app/getannot.py
+++ b/app/getannot.py
@@ -1,38 +1,75 @@
-#https://gist.github.com/mjlavin80/186a6395c5819dbe25a8a0e001d5acfd
+
+
+# #https://gist.github.com/mjlavin80/186a6395c5819dbe25a8a0e001d5acfd
+# import requests
+# import json
+
+
+
+# # This script demonstrates how to query annotations for a particular URL using the hypothes.is API. An API key is required.
+# # The end result of this script is a Python dictionary with annotation data in it. Top save to csv or other format, further parsing would be required
+# def get_annotations():
+
+
+
import requests
import json
+# This script demonstrates how to query annotations for a particular URL using the hypothes.is API. An API key is required.
+# The end result of this script is a Python dictionary with annotation data in it. Top save to csv or other format, further parsing would be required
def get_annotations():
- KEY = "6879-rwfbfodYqhBn2OK2ODnNGkzlWUa4bPCoJi2U8pgTYHg"
+ KEY = "6879-n8AksBoSB7kYoQ3eEwzpEr3nFQEmSp3XN-0PcKL_Sik"
+ # URL = "https://monoskop.org/Monoskop"
+
+ #a dictionary containing necessary http headers
+ headers = {
+ "Host": "hypothes.is",
+ "Accept": "application/json",
+ "Authorization": "Bearer %s" % KEY
+ }
- headers = {
- "Host": "xppl",
- "Accept": "application/json",
- "Content-Type": "application/json",
- "Authorization": "Bearer %s" % KEY
- }
+ base_url = "https://hypothes.is/api/search?user=xpub@hypothes.is"
- search_url = "".join("http://localhost:5000/api/search")
+ search_url = "".join([base_url])
- r = requests.get(search_url, headers=headers)
- data = json.loads(r.text)
- return data
+ r = requests.get(search_url, headers=headers)
+ #data is a python dictionary
+ data = json.loads(r.text)
- # extract=[]
- # for item in data['rows']:
- # # if 'exact' in item['target'][0]['selector'][2]:
- # if 'selector' in item['target'][0]:
- # if len(item['target'][0]['selector']) > 2:
- # extract.append('extract:' + (item['target'][0]['selector'][2]['exact']))
- # extract.append('annotation:' + item['text'])
- # extract.append ('-----------')
- # else:
- # extract.append('annotation:' + item['text'])
- # extract.append ('-----------')
- # return extract
+ # r = requests.get(search_url, headers=headers)
+ # data = json.loads(r.text)
+ return data
+def get_annot_results(annot,name):
+ res=[]
+ annot=get_annotations()
+ for item in annot['rows']:
+ if 'selector' in item['target'][0]:
+ if len(item['target'][0]['selector'])>2:
+ if name in item['text'] or name in item['target'][0]['selector'][2]['exact']:
+ data={'text': item['text'],'extract':item['target'][0]['selector'][2]['exact'],'title':item['document']['title']}
+ res.append(data)
+ else:
+ if name in item['text'] or name in item['target'][0]['selector'][1]['exact']:
+ data={'text': item['text'],'extract':item['target'][0]['selector'][1]['exact'],'title':item['document']['title']}
+ res.append(data)
+ return res
+def get_annot_book(annot,name):
+ bannot=[]
+ annot=get_annotations()
+ for item in annot['rows']:
+ if 'selector' in item['target'][0]:
+ if len(item['target'][0]['selector'])>2:
+ if name==item['uri']:
+ data={'text': item['text'],'extract':item['target'][0]['selector'][2]['exact'],'title':item['document']['title']}
+ bannot.append(data)
+ else:
+ if name in item['uri']:
+ data={'text': item['text'],'extract':item['target'][0]['selector'][1]['exact'],'title':item['document']['title']}
+ bannot.append(data)
+ return bannot
diff --git a/app/static/css/style.css b/app/static/css/style.css
index 6ae5dd1..2f6aa8c 100755
--- a/app/static/css/style.css
+++ b/app/static/css/style.css
@@ -437,3 +437,12 @@ box-sizing: border-box;
text-decoration: none;
cursor: pointer;
}
+
+
+body { font-family: "Archivo Narrow"}
+nav { font-size: .7em }
+
+@page { size: A5; margin: 1cm }
+@media print {
+ nav { display: none }
+}
\ No newline at end of file
diff --git a/app/static/viewer/web/viewer.html b/app/static/viewer/web/viewer.html
index 9d75574..ab725c9 100755
--- a/app/static/viewer/web/viewer.html
+++ b/app/static/viewer/web/viewer.html
@@ -413,25 +413,35 @@ http://sourceforge.net/adobe/cmap/wiki/License/
-
-
-
+
+
+
+
+
@@ -465,12 +475,15 @@ window.hypothesisConfig = function () {
-->
- -->
+
+
+
+
-
-
- -->
+
+
+
+