From 35a2a3c1f211235705c8b72cbda76e5234847349 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 27 Jun 2021 19:32:50 +0200 Subject: [PATCH] Rootclaim tweak --- src/platforms/rootclaim-fetch.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platforms/rootclaim-fetch.js b/src/platforms/rootclaim-fetch.js index e8888be..2730a3a 100644 --- a/src/platforms/rootclaim-fetch.js +++ b/src/platforms/rootclaim-fetch.js @@ -1,6 +1,7 @@ /* Imports */ import fs from 'fs' import axios from "axios" +import toMarkdown from "../utils/toMarkdown.js" import { calculateStars } from "../utils/stars.js" import {upsert} from "../utils/mongo-wrapper.js" @@ -38,11 +39,12 @@ async function fetchAndProcessData() { "type": "PROBABILITY" }) } + let claimUrlPath = claim.created_at < "2020" ? "claim" : "analysis" let obj = ({ "title": claim.question, - "url": "https://www.rootclaim.com/analysis/"+claim.slug, + "url": `https://www.rootclaim.com/${claimUrlPath}/${claim.slug}`, "platform": "Rootclaim", - "description": claim.background, + "description": toMarkdown(claim.background), "options": options, "timestamp": new Date().toISOString(), "qualityindicators": {