Stopped adding to history as MongoDB total size was exceeded
This commit is contained in:
		
							parent
							
								
									3d406ac919
								
							
						
					
					
						commit
						f45e302208
					
				|  | @ -1,3 +1,5 @@ | |||
| import {astralcodexten} from "../platforms/astralcodexten-fetch.js" | ||||
| import {coupcast} from "../platforms/coupcast-fetch.js" | ||||
| import {csetforetell} from "../platforms/csetforetell-fetch.js" | ||||
| import {elicit} from "../platforms/elicit-fetch.js" | ||||
| import {estimize} from "../platforms/estimize-fetch.js" | ||||
|  | @ -34,7 +36,7 @@ export async function tryCatchTryAgain (fun) { | |||
|     } | ||||
| } | ||||
| export async function doEverything(){ | ||||
|     let functions = [csetforetell, elicit, /* estimize, */ fantasyscotus,  foretold, goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, mergeEverything, addToHistory, rebuildNetlifySiteWithNewData] | ||||
|     let functions = [coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus,  foretold, goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, mergeEverything, /*addToHistory,*/ rebuildNetlifySiteWithNewData] | ||||
| 
 | ||||
|     console.log("") | ||||
|     console.log("") | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import { mongoRead, upsert } from "./mongo-wrapper.js" | ||||
| 
 | ||||
| /* Merge everything */ | ||||
| let sets = ["csetforetell", "elicit", "estimize", "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "ladbrokes", "metaculus", "polymarket", "predictit", "omen", "smarkets", "williamhill", "xrisk"] | ||||
| let sets = ["astralcodexten","coupcast", "csetforetell", "elicit", "estimize", "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "ladbrokes", "metaculus", "polymarket", "predictit", "omen", "smarkets", "williamhill", "xrisk"] | ||||
| let suffix = "-questions" | ||||
| 
 | ||||
| export async function mergeEverything(){ | ||||
|  |  | |||
|  | @ -27,6 +27,22 @@ export function getStarSymbols(numstars) { | |||
| 
 | ||||
| let average = array => array.reduce((a, b) => a + b, 0) / (array.length) | ||||
| 
 | ||||
| function calculateStarsAstralCodexTen(data) { | ||||
|   let nuno = data => 3 | ||||
|   let eli = (data) => null | ||||
|   let misha = (data) => null | ||||
|   let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)])
 | ||||
|   let starsInteger = Math.round(starsDecimal) | ||||
|   return starsInteger | ||||
| } | ||||
| 
 | ||||
| function calculateStarsCoupCast(data) { | ||||
|   let nuno = (data) => 3 | ||||
|   let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)])
 | ||||
|   let starsInteger = Math.round(starsDecimal) | ||||
|   return starsInteger | ||||
| } | ||||
| 
 | ||||
| function calculateStarsCSETForetell(data) { | ||||
|   let nuno = (data) => data.numforecasts > 100 ? 3 : 2 | ||||
|   let eli = (data) => 3 | ||||
|  | @ -172,6 +188,12 @@ function calculateStarsWilliamHill(data) { | |||
| export function calculateStars(platform, data) { | ||||
|   let stars = 2; | ||||
|   switch (platform) { | ||||
|     case "AstralCodexTen": | ||||
|       stars = calculateStarsAstralCodexTen(data) | ||||
|       break; | ||||
|     case "CoupCast": | ||||
|       stars = calculateStarsCoupCast(data) | ||||
|       break; | ||||
|     case "CSET-foretell": | ||||
|       stars = calculateStarsCSETForetell(data) | ||||
|       break; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user