Rootclaim tweak

This commit is contained in:
NunoSempere 2021-06-27 19:32:50 +02:00
parent 13481b8b0b
commit 35a2a3c1f2

View File

@ -1,6 +1,7 @@
/* Imports */ /* Imports */
import fs from 'fs' import fs from 'fs'
import axios from "axios" import axios from "axios"
import toMarkdown from "../utils/toMarkdown.js"
import { calculateStars } from "../utils/stars.js" import { calculateStars } from "../utils/stars.js"
import {upsert} from "../utils/mongo-wrapper.js" import {upsert} from "../utils/mongo-wrapper.js"
@ -38,11 +39,12 @@ async function fetchAndProcessData() {
"type": "PROBABILITY" "type": "PROBABILITY"
}) })
} }
let claimUrlPath = claim.created_at < "2020" ? "claim" : "analysis"
let obj = ({ let obj = ({
"title": claim.question, "title": claim.question,
"url": "https://www.rootclaim.com/analysis/"+claim.slug, "url": `https://www.rootclaim.com/${claimUrlPath}/${claim.slug}`,
"platform": "Rootclaim", "platform": "Rootclaim",
"description": claim.background, "description": toMarkdown(claim.background),
"options": options, "options": options,
"timestamp": new Date().toISOString(), "timestamp": new Date().toISOString(),
"qualityindicators": { "qualityindicators": {