mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
change to processUsers script
This commit is contained in:
parent
c516d2ef6e
commit
a7ae2030f0
1 changed files with 10 additions and 10 deletions
|
@ -59,9 +59,9 @@ async function convert(text, from, to) {
|
||||||
from: from,
|
from: from,
|
||||||
to: to
|
to: to
|
||||||
};
|
};
|
||||||
if(!cache[to])
|
if (!cache[to])
|
||||||
cache[to] = {};
|
cache[to] = {};
|
||||||
if(cache[to][text])
|
if (cache[to][text])
|
||||||
return cache[to][text];
|
return cache[to][text];
|
||||||
var translated_text = await translate(text, options);
|
var translated_text = await translate(text, options);
|
||||||
cache[to][text] = translated_text.text;
|
cache[to][text] = translated_text.text;
|
||||||
|
@ -125,7 +125,6 @@ puppeteer
|
||||||
|
|
||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
fs.mkdirSync(dir);
|
fs.mkdirSync(dir);
|
||||||
}
|
|
||||||
console.log(i, users[i].title);
|
console.log(i, users[i].title);
|
||||||
fs.writeFileSync(dir + '/index.md', userMDFile);
|
fs.writeFileSync(dir + '/index.md', userMDFile);
|
||||||
for (var j in targetLangs) {
|
for (var j in targetLangs) {
|
||||||
|
@ -135,6 +134,7 @@ puppeteer
|
||||||
await page.goto(users[i].url);
|
await page.goto(users[i].url);
|
||||||
await page.screenshot({ path: dir + "/feature.jpg" });
|
await page.screenshot({ path: dir + "/feature.jpg" });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue