Skip to content

Commit

Permalink
Merge pull request ClementCariou#20 from art-institute-of-chicago/pub…
Browse files Browse the repository at this point in the history
…lic-domain

Only show public domain artworks
  • Loading branch information
ClementCariou authored Aug 10, 2021
2 parents c7c9162 + 9bc6b98 commit f31dab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions api/artic.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'strict mode';

// ARTIC API
//const noCors = 'https://cors-anywhere.herokuapp.com/';
const noCors = 'https://api.allorigins.win/raw?url=';
const searchURL = 'https://aggregator-data.artic.edu/api/v1/artworks/search';
const searchURL = 'https://api.artic.edu/api/v1/artworks/search';
const imageURL = ({image_id}, res) => `https://www.artic.edu/iiif/2/${image_id}/full/,${res}/0/default.jpg`;
const query = '?query[bool][must][][term][classification_titles.keyword]=painting';
const query = '?query[bool][must][][term][classification_titles.keyword]=painting&query[bool][must][][term][is_public_domain]=true';
const fields = '&fields=image_id,title,artist_title';
module.exports = {
fetchList: async function (from, count) {
Expand All @@ -14,7 +12,7 @@ module.exports = {
return json.data.filter((d) => d.image_id);
},
fetchImage: async function (obj, advicedResolution) {
const url = noCors + imageURL(obj, advicedResolution);
const url = imageURL(obj, advicedResolution);
const blob = await fetch(url).then(res => res.blob());
return {
title: obj.title + " - " + obj.artist_title,
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This project simulates an art gallery in your browser using [REGL](https://github.com/regl-project/regl).
It aims at reproducing the experience of a real art gallery.
The architecture is generated using a 10km long 6th order [Hilbert Curve](https://en.wikipedia.org/wiki/Hilbert_curve).
The paintings are asynchronously loaded from the [ARTIC](https://aggregator-data.artic.edu/home) and placed on the walls.
The paintings are asynchronously loaded from the [ARTIC](https://api.artic.edu) and placed on the walls.
You can use this project to display your own artworks.

## Setup
Expand Down

0 comments on commit f31dab4

Please sign in to comment.