2021-03-05 14:12:49 +01:00
|
|
|
|
2021-06-15 13:26:07 +02:00
|
|
|
const { howlongtobeat, webmention, youtube } = require('jam-my-stack');
|
2021-03-05 14:12:49 +01:00
|
|
|
const fsp = require('fs').promises;
|
|
|
|
|
|
|
|
|
|
|
|
(async function() {
|
2021-06-15 13:26:07 +02:00
|
|
|
// 1. get how long to beat times
|
2021-03-05 14:12:49 +01:00
|
|
|
console.log("1. adding Howlongtobeat info...")
|
|
|
|
await howlongtobeat.howlong(`${__dirname}/content/articles`)
|
|
|
|
|
2021-06-15 13:26:07 +02:00
|
|
|
// 2. get webmentions
|
2021-03-19 21:34:19 +01:00
|
|
|
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')
|
|
|
|
|
2021-06-15 13:26:07 +02:00
|
|
|
// 3. send webmentions
|
2021-03-19 21:34:19 +01:00
|
|
|
console.log("3. Sending webmentions...")
|
2021-04-16 16:40:03 +02:00
|
|
|
await webmention.send("jefklakscodex.com")
|
2021-03-19 21:34:19 +01:00
|
|
|
|
2021-06-15 13:26:07 +02:00
|
|
|
// 4. generate youtube thumbnails.
|
|
|
|
console.log("4. Generating YouTube thumbnails...")
|
|
|
|
await youtube.thumbify({
|
|
|
|
postDir: `${__dirname}/content/articles`,
|
|
|
|
downloadDir: `${__dirname}/static/img/yt`,
|
|
|
|
overlayImg: `${__dirname}/play.png`
|
|
|
|
})
|
|
|
|
|
2021-03-05 14:12:49 +01:00
|
|
|
console.log("-- all done!")
|
|
|
|
})()
|