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');
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,