Skip to content

Commit 38c1913

Browse files
committed
0.6.1
1 parent bd771ef commit 38c1913

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.6.1 / 2015-02-17
2+
==================
3+
* Added setting output format for user, artist and label profiles through `DiscogsClient.setConfig({outputFormat: 'html'})`
4+
15
0.6.0 / 2015-01-19
26
==================
37
* OAuth authentication is no longer embedded in `DiscogsClient`

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

3-
Copyright (c) 2014 B. van Eijck <voodoo107@hotmail.com>
3+
Copyright (c) 2014-2015 B. van Eijck <voodoo107@hotmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ col.releases('USER_NAME', 0, {page: 2, per_page: 75}, function(err, data){
6666
});
6767
```
6868

69+
### Output format
70+
User, artist and label profiles can be formatted in different ways: `plaintext`, `html` and `discogs`. `disconnect` defaults to `discogs`, but the output format can be set for each client instance.
71+
```javascript
72+
// Set the output format to HTML
73+
var dis = new Discogs().setConfig({outputFormat: 'html'});
74+
```
75+
6976
### Discogs Auth
7077
Just provide the client constructor with your preferred way of [authentication](http://www.discogs.com/developers/#page:authentication).
7178
```javascript

lib/client.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports = DiscogsClient;
1717
var defaultConfig = {
1818
host: 'api.discogs.com',
1919
port: 443,
20-
userAgent: 'DisConnectClient/'+pkg.version+' +'+pkg.homepage
20+
userAgent: 'DisConnectClient/'+pkg.version+' +'+pkg.homepage,
21+
outputFormat: 'discogs' // Possible values: 'discogs' / 'plaintext' / 'html'
2122
};
2223

2324
/**
@@ -127,7 +128,7 @@ DiscogsClient.prototype._rawRequest = function(options, callback){
127128
// Build request headers
128129
var headers = {
129130
'User-Agent': this.config.userAgent,
130-
'Accept': 'application/json; application/octet-stream',
131+
'Accept': 'application/json,application/vnd.discogs.v2.'+this.config.outputFormat+'+json,application/octet-stream',
131132
'Accept-Encoding': 'gzip,deflate',
132133
'Host': this.config.host,
133134
'Connection': 'close',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "disconnect",
33
"description": "An easy to use client library to connect with the discogs.com API v2.0",
4-
"version": "0.6.0",
4+
"version": "0.6.1",
55
"keywords": ["discogs", "api", "client", "oauth"],
66
"homepage": "https://github.com/bartve/disconnect",
77
"bugs": "https://github.com/bartve/disconnect/issues",

0 commit comments

Comments
 (0)