Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
node.jsでKyokoさんに源氏物語1章を朗読してもらう
var client = require('cheerio-httpcli');
var execSync = require('child_process').execSync;
client.fetch('http://attic.neophilia.co.jp/aozora/genjimonogatari/htmlfiles/kiritsubo.html', {}, (err, $, res) => {
$('p').each(function(idx) {
$(this)[0].children
.filter(item => item.type === 'text')
.map(item => item.data.replace(/.+/g, ''))
.forEach(item => execSync(`say ${item}`));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.