~rbdr/pinboard-linkblog-updater

70dc59db0627b43811ee8e6d00a5d67542662209 — Ruben Beltran del Rio 2 months ago 9d9552d main
Use new blog version
1 files changed, 5 insertions(+), 7 deletions(-)

M index.js
M index.js => index.js +5 -7
@@ 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,