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 Jul 13, 2015
2 parents 1622593 + ce6d7a5 commit 76814c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,10 @@ module.exports = (function() {
var req = request.post(flickrURL, function(error, response, body) {
// format:json does not actually work, so we need to grab the photo ID from the response XML:
// <?xml version="1.0" encoding="utf-8" ?>\n<rsp stat="ok">\n<photoid>.........</photoid>\n</rsp>\n
var data = undefined;
if(body.indexOf('rsp stat="ok"')>-1) {
var data;
if(!body) {
error = error || "No body found in response";
} else if (body.indexOf('rsp stat="ok"')>-1) {
data = parseInt(body.split("<photoid>")[1].split("</photoid>")[0], 10);
}
callback(error, data);
Expand Down

0 comments on commit 76814c1

Please sign in to comment.