Skip to content

Commit

Permalink
Fixed issue with metadata - attempt 1
Browse files Browse the repository at this point in the history
  • Loading branch information
am1t committed Aug 19, 2018
1 parent f79df9e commit 5542e6b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,19 @@ const syndicate = function(doc) {
body : 'status=' + content,
headers : {'Authorization': 'Bearer ' + config.mastodon_token}
}
request.post(options, function(error, response, body){
if(error){
console.log("Failed to syndicate post. " + error);
return "\n";
} else {
body = JSON.parse(body);
console.log("Post syndicated to Mastodon instance " + body.url.toString());
return "syndicated-to : " + body.url.toString() + "\n";
}
return new Promise((resolve,reject) => {
request.post(options, function(error, response, body){
if(error){
console.log("Failed to syndicate post. " + error);
resolve(config.mastodon_instance);
} else {
body = JSON.parse(body);
console.log("Post syndicated to Mastodon instance " + body.url.toString());
resolve(body.url.toString());
}
});
});
});
}).then(result => "syndicated-to : " + result + "\n");
} else {
return Promise.resolve('\n');
}
Expand Down

0 comments on commit 5542e6b

Please sign in to comment.