jefklakscodex/jamstack-init.js

22 lines
638 B
JavaScript
Raw Normal View History

2021-03-05 14:12:49 +01:00
2021-03-19 21:34:19 +01:00
const { howlongtobeat, webmention } = require('jam-my-stack');
2021-03-05 14:12:49 +01:00
const fsp = require('fs').promises;
(async function() {
console.log("1. adding Howlongtobeat info...")
await howlongtobeat.howlong(`${__dirname}/content/articles`)
2021-03-19 21:34:19 +01:00
// 4. get webmentions
console.log("2. Fetching webmentions...")
const mentions = await webmention.getWebmentions("jefklakscodex.com")
const json = JSON.stringify(mentions, null, 4)
await fsp.writeFile(`${__dirname}/data/webmentions.json`, json, 'utf-8')
// 5. send webmentions
console.log("3. Sending webmentions...")
await webmention.send("jefklakscodex.com")
2021-03-19 21:34:19 +01:00
2021-03-05 14:12:49 +01:00
console.log("-- all done!")
})()