Last active
September 21, 2017 21:39
-
-
Save saul-mtz/a6a09fca22021195d012f732fb959e2f to your computer and use it in GitHub Desktop.
Importa el contenido de http://comoayudar.mx y lo guarda en un archivo llamado cards.json
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
/** | |
* @author: saul.mtz.v | |
* | |
* Importa el contenido de http://comoayudar.mx | |
* y lo guarda en un archivo llamado cards.json | |
* | |
* Ejectuar: | |
* node cardsToJSON.js | |
*/ | |
const http = require('https'); | |
const fs = require('fs'); | |
const url = 'https://raw.githubusercontent.com/eldelentes/comoayudarmx/master/cards.js'; | |
const fileName = 'cards.json'; | |
var script = ''; | |
http.get(url, function(res) { | |
res.on('data', function(d) { | |
script += d.toString(); | |
}); | |
}).on('close', function(e) { | |
const cards = eval(script); | |
fs.writeFileSync(fileName, JSON.stringify(cards, null, 2)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment