-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anton Lysenko
committed
Sep 25, 2018
1 parent
cd00e59
commit 50d9feb
Showing
6 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = yargs => { | ||
|
||
yargs | ||
.describe('b', 'Blog name from where the post') | ||
.usage('Usage: $0 postInfo -c [file] -b [blog] --id <post-id>') | ||
.option('id', { | ||
describe: 'Tumblr post id', | ||
demandOption: true, | ||
type: 'string', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const tumblrJs = require('tumblr.js'); | ||
|
||
module.exports = async (params) => { | ||
const { id } = params; | ||
|
||
const tumblr = tumblrJs.createClient({ | ||
credentials: params.credentials, | ||
returnPromises: true, | ||
}); | ||
|
||
try { | ||
const result = await tumblr.blogPosts(params.blog, { id }); | ||
console.log(result); | ||
return result; | ||
} catch (error) { | ||
console.error(error); | ||
return error; | ||
} | ||
} |