Skip to content

Commit

Permalink
Merge 6ad776d into c9f3671
Browse files Browse the repository at this point in the history
  • Loading branch information
tcme committed Sep 23, 2016
2 parents c9f3671 + 6ad776d commit 697a420
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,20 @@ You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to crea

```js
const got = require('got');
const crypto = require('crypto');
const OAuth = require('oauth-1.0a');

const oauth = OAuth({
consumer: {
public: process.env.CONSUMER_KEY,
key: process.env.CONSUMER_KEY,
secret: process.env.CONSUMER_SECRET
},
signature_method: 'HMAC-SHA1'
signature_method: 'HMAC-SHA1',
hash_function: (baseString, key) => crypto.createHmac('sha1', key).update(baseString).digest('base64');
});

const token = {
public: process.env.ACCESS_TOKEN,
key: process.env.ACCESS_TOKEN,
secret: process.env.ACCESS_TOKEN_SECRET
};

Expand Down

0 comments on commit 697a420

Please sign in to comment.