Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Pomax/node-flickrapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Jan 18, 2015
2 parents 7ab1f75 + e5c8130 commit 1231dc2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ $> npm install flickrapi --save
```
After that, you have two choices, based on whether you want to authenticate or not. Both approaches require an API key, but using OAuth2 authentication means you get access to the full API, rather than only the public API.

To suppress the progress bars in stdout you can include a `progress` attribute when initializing:

```
var flickr = new Flickr({
api_key: "1234ABCD1234ABCD1234ABCD1234ABCD",
progress: false
});
```

### No authentication, public API only

```
Expand Down Expand Up @@ -386,9 +395,12 @@ options = {
// only performs authentication, without building the Flickr API.
noAPI: true,
// supress the default console logging on successful authentication.
// suppress the default console logging on successful authentication.
silent: true,
// suppress writing progress bars to stdout
progress: false
...
}
```
Expand Down Expand Up @@ -459,4 +471,7 @@ optional boolean, console.logs the auth URL instead of opening a browser window
optional boolean, performs authentication without building the Flickr API object.

###silent
optional boolean, supresses the default console logging on successful authentication.
optional boolean, suppresses the default console logging on successful authentication.

###progress
optional boolean, suppresses writing progress bars to stdout if set to `false`
2 changes: 1 addition & 1 deletion src/auth/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = (function() {
options = Utils.setAuthVals(options);

var queryArguments = {
oauth_callback: encodeURIComponent(options.callback),
oauth_callback: options.callback,
oauth_consumer_key: options.api_key,
oauth_nonce: options.oauth_nonce,
oauth_timestamp: options.oauth_timestamp,
Expand Down
6 changes: 4 additions & 2 deletions src/flickr-api-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ module.exports = (function() {
filename = mdir + "/" + method_name + ".json";

// advance the progress bar
progressBar.tick();
if(progressBar) {
progressBar.tick();
}

var handleResult = function(result) {
var method = result.method,
Expand Down Expand Up @@ -117,7 +119,7 @@ module.exports = (function() {
var methods = result.methods.method.map(function(v) {
return v._content;
});
if(!progressBar) {
if(!progressBar && flickrOptions.progress !== false) {
progressBar = new Progress(' fetching method signatures [:bar] :percent', { total: methods.length });
}
return parseMethods(flickrOptions, methods, 0, finished);
Expand Down

0 comments on commit 1231dc2

Please sign in to comment.