25 lines
749 B
JavaScript
25 lines
749 B
JavaScript
|
|
const { mastodon, goodreads, webmention, youtube } = require('jam-my-stack');
|
|
const fsp = require('fs').promises;
|
|
const wmconfig = require('./_conf.js');
|
|
|
|
const rootdir = `${__dirname}/../`;
|
|
|
|
(async function() {
|
|
// 1. get webmentions
|
|
console.log("1. Fetching webmentions...")
|
|
const mentions = await webmention.getWebmentions("brainbaking.com", wmconfig)
|
|
const json = JSON.stringify(mentions, null, 4)
|
|
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
|
|
|
|
// 2. generate youtube thumbnails
|
|
console.log("2. Generating YouTube thumbnails...")
|
|
await youtube.thumbify({
|
|
postDir: `${rootdir}/content/post`,
|
|
downloadDir: `${rootdir}/static/img/yt`,
|
|
overlayImg: `${rootdir}/play.png`
|
|
})
|
|
|
|
console.log("-- all done!")
|
|
})()
|