Skip to content

Commit

Permalink
Fixed issue with metadata - final
Browse files Browse the repository at this point in the history
  • Loading branch information
am1t committed Aug 19, 2018
1 parent 5542e6b commit 163d34b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const syndicate = function(doc) {
? doc.properties['mp-syndicate-to']
: doc.mp['syndicate-to']);
if(syndicate_to.indexOf(config.mastodon_instance) !== -1){
getContent(doc).then(content => {
return getContent(doc).then(content => {
let MASTO_API = config.mastodon_instance + "api/v1/statuses";
content = removeMd(content);
content = content.replace("\'", "'");
Expand All @@ -187,15 +187,15 @@ const syndicate = function(doc) {
request.post(options, function(error, response, body){
if(error){
console.log("Failed to syndicate post. " + error);
resolve(config.mastodon_instance);
resolve("\n");
} else {
body = JSON.parse(body);
console.log("Post syndicated to Mastodon instance " + body.url.toString());
resolve(body.url.toString());
resolve("syndicated-to : " + body.url.toString() + "\n");
}
});
});
}).then(result => "syndicated-to : " + result + "\n");
});
} else {
return Promise.resolve('\n');
}
Expand Down

0 comments on commit 163d34b

Please sign in to comment.