Created
June 8, 2016 00:02
-
-
Save nukosuke/a9c6832b3ea4a0d1e62e96ed5db87b61 to your computer and use it in GitHub Desktop.
node.jsでKyokoさんに源氏物語1章を朗読してもらう
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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