-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
discover.mjs
29 lines (27 loc) · 923 Bytes
/
discover.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import bcfetch from '../../dist/mjs/index.js';
const params = {
genre: 'ambient',
albumImageFormat: 2,
artistImageFormat: 'bio_featured'
};
void (async () => {
const result = await bcfetch.discovery.discover(params);
console.log(JSON.stringify(result, null, 2));
if (result.continuation) {
console.log('Fetching more by continuation...');
const moreResults = await bcfetch.discovery.discover(result.continuation);
console.log(JSON.stringify(moreResults, null, 2));
}
console.log('Fetching shirts...');
const shirtResults = await bcfetch.discovery.discover({
...params,
category: 5
});
console.log(JSON.stringify(shirtResults, null, 2));
console.log('Fetching by custom tags...');
const customTagResults = await bcfetch.discovery.discover({
...params,
customTags: ['dark-ambient', 'drum-and-bass']
});
console.log(JSON.stringify(customTagResults, null, 2));
})();