Created
June 30, 2021 04:22
-
-
Save ries9112/eeeb9defd2931d8acae68a0d492c16db to your computer and use it in GitHub Desktop.
This is Ricky's CV script of the gallery that displays the most recent artwork from hic et nunc (https://www.cryptovoxels.com/play?coords=SE@6922W,34S). This is an adaptation where the GraphQL query returns data for audio objkts (as requested by @Mighty_33)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature.on('click',e=>{ | |
fetch('https://api.hicdex.com/v1/graphql', { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json', | |
}, | |
body: JSON.stringify({ | |
query: ` | |
query MyQuery { | |
hic_et_nunc_token(order_by: {timestamp: desc}, limit: 10, where: {mime: {_eq: "audio/wav"}}) { | |
display_uri | |
id | |
mime | |
timestamp | |
royalties | |
supply | |
title | |
} | |
} | |
`, | |
}), | |
}) | |
.then((res) => res.json()) | |
.then((result) => { | |
// do stuff here | |
console.log(result); | |
console.log(result.data); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment