Created
November 14, 2015 01:54
-
-
Save jem-computer/9e60ac6968564012bc3a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { join, map, pipe, split, take, toLower } from 'ramda' | |
import { getFreeFonts } from './parselist' | |
import { createReadStream } from 'fs' | |
import { parse } from 'csv' | |
import { loadDetailPage } from './scrapefontwolf' | |
const csvParser = parse({ delimiter: ',' }, (err, data) => { | |
if (err) throw err | |
pipe( | |
take(5), | |
map(toLower), | |
map(split(' ')), | |
map(join('-')), | |
map((font) => { | |
return loadDetailPage(font).then((usages) => { | |
return {font, usages} | |
}) | |
}) | |
)(getFreeFonts(data)) | |
}) | |
module.exports = { | |
getWhitelist: () => createReadStream(__dirname + '/FontWolf.csv', 'utf8').pipe(csvParser) | |
} | |
module.exports.getWhitelist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment