X-Git-Url: https://git.r.bdr.sh/rbdr/linkding-linkblog-updater/blobdiff_plain/9d9552d186c136c8252a5a5b1abc972279624061..70dc59db0627b43811ee8e6d00a5d67542662209:/index.js?ds=inline diff --git a/index.js b/index.js index 518cc79..279594a 100644 --- a/index.js +++ b/index.js @@ -64,10 +64,8 @@ const internals = { async function run() { const pinboard = new Pinboard(internals.apiToken); - const getPins = promisify(pinboard.all); - const addPin = promisify(pinboard.add); - const pins = await getPins({ tag: 'linkblog' }); + const pins = await pinboard.all({ tag: 'linkblog' }); if (pins.length === 0) { console.error('No links to post'); @@ -81,13 +79,13 @@ async function run() { const gemfile = resolve(join(__dirname, `${filename}.gmi`)); await writeFile(gemfile, gemtext); - await internals.exec(`blog --add ${gemfile}`); - await internals.exec(`blog --publish ${internals.blogUrl}`); - await internals.exec(`blog --publish-archive ${internals.archiveUrl}`); + await internals.exec(`blog add ${gemfile}`); + await internals.exec(`blog publish ${internals.blogUrl}`); + await internals.exec(`blog publish-archive ${internals.archiveUrl}`); await rm(gemfile); for (const pin of pins) { - await addPin({ + await pinboard.add({ url: pin.href, description: pin.description, extended: pin.extended,