OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
87 stars 18 forks source link

WikiDATA (i.e. not wikipedia) pages rely on http://cors-anywhere.herokuapp.com/ - yuck! #73

Open hyanwong opened 6 years ago

hyanwong commented 6 years ago

~E.g. at the moment on the dev code, you can't get a wiki page for the tuatara.~

hyanwong commented 6 years ago

We probably want something like the following URL to be used if there is no direct Qid: https://en.wikipedia.org/w/api.php?action=query&list=search&srprop=&srlimit=1&srsearch=Sphenodon%20punctatus

hyanwong commented 6 years ago

Now made much nicer. Unfortunately relies on http://cors-anywhere.herokuapp.com/ to inject the wikidata page (see https://github.com/OneZoom/OZtree/blob/fa42430996a6721b45080c32a17eaae7564c833a/views/tree/wikipedia_OZpage.html#L166). Fortunately we shouldn't see the wikidata page very often, so not too much of a problem. However, eventually I would like to move away from requiring a CORS service to embed wikiDATA pages in wikipedia_OZpage.html. I have no idea how to do this, as the REST_V1 API which is used to embed wikipedia pages in OneZoom (and which allows CORS directly) is inadequate for the purpose (see https://www.wikidata.org/wiki/Wikidata:Project_chat#REST_API_format_for_wikidata). I wonder if @lentinj has any ideas how this might be done?

hyanwong commented 6 years ago

Reopened with name change

hyanwong commented 6 years ago

The proper way to solve this is to address https://phabricator.wikimedia.org/T192687. One possibility, discussed with @lentinj is to simply embed the wikidata page as an iframe, but @jrosindell doesn't like this solution, as it will make the iframe-pinch-zoom issue (https://github.com/OneZoom/OZtree/issues/46) resurface.

hyanwong commented 3 years ago

There's currently discussion about the REST API on WD at https://www.wikidata.org/wiki/Wikidata_talk:REST_API_feedback_round, and I've fed some thoughts in.