X-Git-Url: https://git.r.bdr.sh/rbdr/linkding-linkblog-updater/blobdiff_plain/2390d230fa9ff119cddd90250c83ebb220947c0d..28414efe202e391d22012590c932f676f80c3323:/index.js diff --git a/index.js b/index.js index e1aaebf..c0e41dc 100644 --- a/index.js +++ b/index.js @@ -28,17 +28,17 @@ const internals = { async function run() { const pinboard = new Pinboard(internals.apiToken); - const getPins = promisify(pinboard.get); + const getPins = promisify(pinboard.all); const addPin = promisify(pinboard.add); const pins = await getPins({ tag: 'linkblog' }); - if (pins.posts.length === 0) { + if (pins.length === 0) { console.error('No links to post'); return; } - const gemtext = internals.generateGemtext(pins.posts); + const gemtext = internals.generateGemtext(pins); const gemfile = resolve(join(__dirname, `linkblog-${internals.date}.gmi`)); await writeFile(gemfile, gemtext); await internals.exec(`blog --add ${gemfile}`); @@ -46,7 +46,7 @@ async function run() { await internals.exec(`blog --publish-archive ${internals.archiveUrl}`); await rm(gemfile); - for (const pin of pins.posts) { + for (const pin of pins) { await addPin({ url: pin.href, description: pin.description,