fix: weird problem with GiveWell dates
This commit is contained in:
parent
927114a8cc
commit
752a5b2cfe
|
@ -324,7 +324,7 @@ export async function pgInsertIntoDashboard({ datum, schema, tableName }) {
|
|||
creator text,
|
||||
extra json
|
||||
*/
|
||||
|
||||
/*
|
||||
pgInsertIntoDashboard({
|
||||
datum: {
|
||||
title: "Test dashboard",
|
||||
|
@ -341,7 +341,7 @@ pgInsertIntoDashboard({
|
|||
schema: "latest",
|
||||
tableName: "dashboards",
|
||||
});
|
||||
|
||||
*/
|
||||
export async function pgUpsert({ contents, schema, tableName }) {
|
||||
if (tableWhiteList.includes(`${schema}.${tableName}`)) {
|
||||
if (schema == "latest") {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"probability": 0.75,
|
||||
"type": "PROBABILITY"
|
||||
}
|
||||
],
|
||||
],
|
||||
"timestamp": "2021-02-23T15∶21∶37.005Z",
|
||||
"qualityindicators": {
|
||||
"stars": 2
|
||||
|
|
|
@ -23,7 +23,7 @@ async function fetchPage(url) {
|
|||
|
||||
/* Body */
|
||||
|
||||
async function main() {
|
||||
async function main1() {
|
||||
let rawdata = fs.readFileSync("./src/input/givewellopenphil-urls.txt");
|
||||
let data = rawdata
|
||||
.toString()
|
||||
|
@ -64,7 +64,18 @@ async function main() {
|
|||
}
|
||||
// let string = JSON.stringify(results, null, 2)
|
||||
// fs.writeFileSync('./data/givewell-questions-unprocessed.json', string);
|
||||
await databaseUpsert({ contents: results, group: "givewell-questions-unprocessed" });
|
||||
|
||||
await databaseUpsert({
|
||||
contents: results,
|
||||
group: "givewell-questions-unprocessed",
|
||||
});
|
||||
}
|
||||
main();
|
||||
// main1()
|
||||
|
||||
async function main2() {
|
||||
let rawdata = fs.readFileSync("./src/input/givewellopenphil-questions.json");
|
||||
let data = JSON.parse(rawdata);
|
||||
let dataWithDate = data.map(datum => ({...datum, timestamp: '2021-02-23'}))
|
||||
await databaseUpsert({ group: "givewellopenphil", contents: dataWithDate });
|
||||
}
|
||||
main2();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user