]> git.r.bdr.sh - rbdr/pinboard-linkblog-updater/blobdiff - index.js
Use all instead of get
[rbdr/pinboard-linkblog-updater] / index.js
index b6c3e10d10f0ca09be10d20f843b353215c9ef2c..c0e41dc9169898af3fe2e53dcab94d28f41cb3ae 100644 (file)
--- a/index.js
+++ b/index.js
@@ -33,12 +33,12 @@ async function run() {
 
   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,