Skip to content

Commit

Permalink
0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bartve committed Feb 17, 2015
1 parent bd771ef commit 38c1913
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.6.1 / 2015-02-17
==================
* Added setting output format for user, artist and label profiles through `DiscogsClient.setConfig({outputFormat: 'html'})`

0.6.0 / 2015-01-19
==================
* OAuth authentication is no longer embedded in `DiscogsClient`
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2014 B. van Eijck <[email protected]>
Copyright (c) 2014-2015 B. van Eijck <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ col.releases('USER_NAME', 0, {page: 2, per_page: 75}, function(err, data){
});
```

### Output format
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.
```javascript
// Set the output format to HTML
var dis = new Discogs().setConfig({outputFormat: 'html'});
```

### Discogs Auth
Just provide the client constructor with your preferred way of [authentication](http://www.discogs.com/developers/#page:authentication).
```javascript
Expand Down
5 changes: 3 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = DiscogsClient;
var defaultConfig = {
host: 'api.discogs.com',
port: 443,
userAgent: 'DisConnectClient/'+pkg.version+' +'+pkg.homepage
userAgent: 'DisConnectClient/'+pkg.version+' +'+pkg.homepage,
outputFormat: 'discogs' // Possible values: 'discogs' / 'plaintext' / 'html'
};

/**
Expand Down Expand Up @@ -127,7 +128,7 @@ DiscogsClient.prototype._rawRequest = function(options, callback){
// Build request headers
var headers = {
'User-Agent': this.config.userAgent,
'Accept': 'application/json; application/octet-stream',
'Accept': 'application/json,application/vnd.discogs.v2.'+this.config.outputFormat+'+json,application/octet-stream',
'Accept-Encoding': 'gzip,deflate',
'Host': this.config.host,
'Connection': 'close',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "disconnect",
"description": "An easy to use client library to connect with the discogs.com API v2.0",
"version": "0.6.0",
"version": "0.6.1",
"keywords": ["discogs", "api", "client", "oauth"],
"homepage": "https://github.com/bartve/disconnect",
"bugs": "https://github.com/bartve/disconnect/issues",
Expand Down

0 comments on commit 38c1913

Please sign in to comment.