Data Sources: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 88: Line 88:
# Select discogs.js
# Select discogs.js


Script example of using this library:
Example of using this library:
: [[insert script]]
<source lang="JavaScript">
var discogs = new Discogs("Consumer key" ,"Consumer secret" , "release");
var r = discogs.search(query);
result(r, function(id) {return discogs.extra(id);});
</source>


* Consumer key and consumer secret are the keys required to execute the request. They may be obtained at http://discogs.com/settings/developers.
* Consumer key and consumer secret are the keys required to execute the request. They may be obtained at http://discogs.com/settings/developers.
* After the script is written, it is necessary to map the object properties to the fields of the library. Available object properties are documented in the discogs API documentation. See an example of a response to a successful request at [[insert URL]].
* After the script is written, it is necessary to map the object properties to the fields of the library. Available object properties are documented in the discogs API documentation. See an example of a response to a successful request at https://www.discogs.com/developers/#page:database,header:database-release.
* If the search in the data source is done by barcode, use discogs.barcode(query) instead of discogs.search(query).
* If the search in the data source is done by barcode, use discogs.barcode(query) instead of discogs.search(query).


[[Category:Spec]]
[[Category:Spec]]