JavaScript for Discogs API v2

141 views
Skip to first unread message

Pete Wright

unread,
Nov 17, 2024, 1:18:07 AM11/17/24
to mementodatabase
Hello everyone,

does anyone use Mementeo to query/search in the Discogs database?

Is there a JavaScript for the API v2?

I found some code, but it only works with the API v1 where discogs used "Consumer key" and "Consumer secret" but now the use tokens.

Any help appreciated

Alex Sk

unread,
Nov 17, 2024, 7:24:28 AM11/17/24
to mementodatabase

Hello,

Honestly, I've got no experience with the Discogs, but a quick look revealed a link:
https://github.com/bartve/disconnect

Seems it covers both key-secret and tokens :

// Authenticate by user token
var dis = new Discogs({userToken: 'YOUR_USER_TOKEN'});

// Authenticate by consumer key and secret
var dis = new Discogs({
   consumerKey: 'YOUR_CONSUMER_KEY',
   consumerSecret: 'YOUR_CONSUMER_SECRET'
});

Alex Sk

unread,
Nov 17, 2024, 7:28:51 AM11/17/24
to mementodatabase
But you will hardly be able to use node.js, as Memento uses Rhino.

Mmm

unread,
Nov 17, 2024, 8:28:21 AM11/17/24
to mementodatabase
Поделитесь своей библиотекой, чтобы понять какие данные нужно получить. 

воскресенье, 17 ноября 2024 г. в 15:28:51 UTC+3, kuo...@gmail.com:

Mmm

unread,
Nov 18, 2024, 3:23:59 PM11/18/24
to mementodatabase
Опыта работы с Discogs тоже нет.
Варианта библиотеки не увидел. 
За исходник принята библиотека:

Доработано:

1. Авторизация по токену. 

2. Автозаполнение по любому из двух полей "title", "artists". 
Рекомендации:
- Для поиска композиций - поле "title". 
- Для поиска исполнителей - поле "artists". 

3. Встроенную JS библиотеку discogs.js подключать не нужно. 
Ее измененная версия сохранена в общем скрипте. 

Шаблон с примером:

воскресенье, 17 ноября 2024 г. в 16:28:21 UTC+3, Mmm:
Reply all
Reply to author
Forward
0 new messages