hbz / lobid-blog

The source for the lobid blog at https://blog.lobid.org
http://blog.lobid.org/
3 stars 2 forks source link

Monitor hypothes.is annotations on (blog.)lobid.org #36

Open acka47 opened 5 years ago

acka47 commented 5 years ago

As we only get notifications when somebody answers to our annotations we somehow have to monitor whether we have some new comments/notifications on our blog. Unfortunately, hypothes.is hasn't implemented such a feature yet although it has been requested multiple times for some years now (see https://github.com/hypothesis/product-backlog/issues/30 and https://github.com/hypothesis/product-backlog/issues/201). However, there exists a way to query the API for parts of the URL, see https://github.com/hypothesis/client/issues/739#issuecomment-396281964. For the lobid blog the query would be https://hypothes.is/api/search?uri.parts=blog&uri.parts=lobid or we could even query for all annotations on lobid.org with https://hypothes.is/api/search?uri.parts=org&uri.parts=lobid.

However, I suggest to write a script that sends an email to semweb@hbz-nrw.de with the annotation body, the user name of the annotator, the creation/modification date, the link to the annotation in context etc. Here is the relevant information from the API response with regard to one specific annotation:

{
  "updated":"2018-08-03T14:11:37.311616+00:00",
  "links":{
    "json":"https://hypothes.is/api/annotations/IpWX5JcnEei10AOCaAhp9w",
    "html":"https://hypothes.is/a/IpWX5JcnEei10AOCaAhp9w",
    "incontext":"https://hyp.is/IpWX5JcnEei10AOCaAhp9w/blog.lobid.org/2018/07/02/lobid-update.html"
  },
  "text":"Vielen Dank, ein sehr hilfreiches Tool! Ich würde mir jetzt natürlich gerne noch zu meinen Matches die GND-Nummer oder Links in eine weitere Spalte schreiben lassen...Vielleicht einen Tipp, wie das ginge?\n\nViele Grüße, Jakob Frohmann",
  "created":"2018-08-03T14:11:37.311616+00:00",
  "uri":"http://blog.lobid.org/2018/07/02/lobid-update.html",
  "user":"acct:JakobFrohmann@hypothes.is",
  "document":{
    "title":[
      "lobid-gnd-Neuigkeiten: Bulk Downloads, OpenRefine-API und mehr"
    ]
  },
  "id":"IpWX5JcnEei10AOCaAhp9w"
}
acka47 commented 5 years ago

By now, also a wildcard_uri parameter exists, see https://web.hypothes.is/blog/using-the-new-wildcard-url-search-api-to-monitor-sitewide-annotation-activity/ & https://web.hypothes.is/help/how-to-use-domain-level-search/. But I could not get it to work via the API, see https://hypothes.is/a/BJL2eBWLEemtrA81YBlvxA.