disconnect
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -0,1 +1,6 @@ | ||
0.6.2 / 2015-02-25 | ||
================== | ||
* `database().image()` now requires the full image url as the first parameter due to the new Discogs image cluster | ||
* Local request throttling by `disconnect` has been disabled for `database().image()` | ||
0.6.1 / 2015-02-17 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -90,8 +90,8 @@ 'use strict'; | ||
* Get an image | ||
* @param {string} file - The image file name | ||
* @param {string} url - The full image url | ||
* @param {function} [callback] - Callback function | ||
*/ | ||
database.image = function(file, callback){ | ||
client.get({url: '/images/'+file, encoding: 'binary', authLevel: 2, json: false}, callback); | ||
database.image = function(url, callback){ | ||
client.get({url: url, encoding: 'binary', queue: false, json: false}, callback); | ||
}; | ||
@@ -98,0 +98,0 @@ |
{ | ||
"name": "disconnect", | ||
"description": "An easy to use client library to connect with the discogs.com API v2.0", | ||
"version": "0.6.1", | ||
"description": "A full featured Discogs API v2.0 client library", | ||
"version": "0.6.2", | ||
"keywords": ["discogs", "api", "client", "oauth"], | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/bartve/disconnect", |
@@ -142,11 +142,12 @@ ## About | ||
### Images | ||
Image requests require authentication and are subject to [rate limiting](http://www.discogs.com/developers/#page:home,header:home-rate-limiting). | ||
Image requests themselves don't require authentication, but obtaining the image URLs through, for example, release data does. | ||
```javascript | ||
var db = new Discogs(accessData).database(), file = 'R-176126-1322456477.jpeg'; | ||
db.image(file, function(err, data, rateLimit){ | ||
// Data contains the raw binary image data | ||
require('fs').writeFile(file, data, 'binary', function(err){ | ||
// See your current limits | ||
console.log(rateLimit); | ||
console.log('Image saved!'); | ||
var db = new Discogs(accessData).database(); | ||
db.release(176126, function(err, data){ | ||
var url = data.images[0].resource_url; | ||
db.image(url, function(err, data, rateLimit){ | ||
// Data contains the raw binary image data | ||
require('fs').writeFile(file, data, 'binary', function(err){ | ||
console.log('Image saved!'); | ||
}); | ||
}); | ||
@@ -153,0 +154,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51653
163