Small tweaks to make the log more manageable

This commit is contained in:
NunoSempere 2021-04-11 20:08:59 +02:00
parent 6346565a1c
commit 965336bf9d
4 changed files with 13 additions and 6 deletions

View File

@ -141,7 +141,7 @@ async function csetforetell_inner(cookie){
"platform": "CSET-foretell",
...moreinfo
})
if(i % 10 == 0){
if(i % 30 == 0){
console.log(`Page #${i}`)
console.log(question)
}
@ -164,7 +164,7 @@ async function csetforetell_inner(cookie){
}
// let string = JSON.stringify(results,null, 2)
// fs.writeFileSync('./data/csetforetell-questions.json', string);
console.log(results)
// console.log(results)
await upsert(results, "csetforetell-questions")

View File

@ -119,5 +119,6 @@ export async function elicit() {
await processArray(results.data)
}
});
await sleep(5000) // needed to wait for Papaparse's callback to be executed.
}
//elicit()

View File

@ -72,6 +72,7 @@ export async function metaculus() {
console.log(`Query #${i}`)
let metaculusQuestions = await fetchMetaculusQuestions(next)
let results = metaculusQuestions.results;
let j=false
for (let result of results) {
if (
(result.publish_time < now) &&
@ -128,6 +129,10 @@ export async function metaculus() {
if (Number(result.number_of_predictions) >= 10) {
// console.log(interestingInfo)
all_questions.push(interestingInfo)
if(!j && (i %% 20 == 0)){
console.log(interestingInfo)
j = true
}
}
}

View File

@ -32,7 +32,8 @@ export async function upsert (contents, documentName, collectionName="metaforeca
const myDocument = await collection.findOne(filter);
// Print to the console
console.log(myDocument.contentsArray.slice(0,3));
console.log(myDocument.contentsArray.slice(0,1
));
} catch (err) {
console.log(err.stack);
}
@ -75,7 +76,7 @@ export async function mongoRead (documentName, collectionName="metaforecastColle
finally {
await client.close();
}
console.log(documentContents.slice(0,10));
console.log(documentContents.slice(0,1));
return documentContents
}
@ -113,6 +114,6 @@ export async function mongoReadWithReadCredentials (documentName, collectionName
finally {
await client.close();
}
// console.log(documentContents.slice(0,10));
// console.log(documentContents.slice(0,1));
return documentContents
}