Added timestamp + quality indicators
This commit is contained in:
parent
01788da517
commit
c83f2a747f
File diff suppressed because it is too large
Load Diff
17136
data/metaforecasts.csv
17136
data/metaforecasts.csv
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
70499
data/metaforecasts_history.json
Normal file
70499
data/metaforecasts_history.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
1802
data/old/xrisk-questions.json
Normal file
1802
data/old/xrisk-questions.json
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"stars": 1
|
"qualityindicators": {
|
||||||
|
"stars": 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Will Joe Biden be the US President at the end of 2021?",
|
"title": "Will Joe Biden be the US President at the end of 2021?",
|
||||||
|
@ -35,6 +37,8 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"stars": 1
|
"qualityindicators": {
|
||||||
|
"stars": 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
File diff suppressed because it is too large
Load Diff
|
@ -105,9 +105,12 @@ async function fetchStats(questionUrl, cookie){
|
||||||
let result = {
|
let result = {
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": options,
|
"options": options,
|
||||||
"numforecasts": numforecasts,
|
"timestamp": new Date().toISOString(),
|
||||||
"numforecasters": numforecasters,
|
"qualityindicators": {
|
||||||
"stars": calculateStars("CSET-foretell", {numforecasts})
|
"numforecasts": numforecasts,
|
||||||
|
"numforecasters": numforecasters,
|
||||||
|
"stars": calculateStars("CSET-foretell", {numforecasts})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -70,9 +70,12 @@ function processArray(arrayQuestions) {
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"numforecasts": numforecasts,
|
"timestamp": new Date().toISOString(),
|
||||||
"numforecasters": numforecasters,
|
"qualityindicators": {
|
||||||
"stars": calculateStars("Elicit", ({}))
|
"numforecasts": numforecasts,
|
||||||
|
"numforecasters": numforecasters,
|
||||||
|
"stars": calculateStars("Elicit", ({}))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(standardObj)
|
results.push(standardObj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,12 @@ export function estimize(){
|
||||||
"platform": "Estimize",
|
"platform": "Estimize",
|
||||||
"description": `A link to Estimize's forecasts for *${companyName}* (sticker symbol ${companyStickerSymbol}). Viewing them requires making a prediction, Wall Street estimates are provided for free`,
|
"description": `A link to Estimize's forecasts for *${companyName}* (sticker symbol ${companyStickerSymbol}). Viewing them requires making a prediction, Wall Street estimates are provided for free`,
|
||||||
"options": [],
|
"options": [],
|
||||||
"stars": 2//calculateStars("Estimize", ({})),
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"numforecasts": numforecasts,
|
||||||
|
"numforecasters": numforecasters,
|
||||||
|
"stars": calculateStars("Estimize", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(standardObj)
|
results.push(standardObj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,8 +84,11 @@ async function processData(data) {
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"numforecasts": predictionData.numForecasts,
|
"timestamp": new Date().toISOString(),
|
||||||
"stars": calculateStars("FantasySCOTUS", ({}))
|
"qualityindicators": {
|
||||||
|
"numforecasts": predictionData.numForecasts,
|
||||||
|
"stars": calculateStars("FantasySCOTUS", ({}))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
console.log(eventObject)
|
console.log(eventObject)
|
||||||
results.push(eventObject)
|
results.push(eventObject)
|
||||||
|
|
|
@ -77,8 +77,11 @@ export async function foretold(){
|
||||||
"platform": "Foretold",
|
"platform": "Foretold",
|
||||||
"description": "",
|
"description": "",
|
||||||
"options": options,
|
"options": options,
|
||||||
"numforecasts": question.measurementCount / 2,
|
"timestamp": new Date().toISOString(),
|
||||||
"stars": calculateStars("Foretold", ({ }))
|
"qualityindicators": {
|
||||||
|
"numforecasts": question.measurementCount / 2,
|
||||||
|
"stars": calculateStars("Foretold", ({ }))
|
||||||
|
}
|
||||||
/*liquidity: liquidity.toFixed(2),
|
/*liquidity: liquidity.toFixed(2),
|
||||||
tradevolume: tradevolume.toFixed(2),
|
tradevolume: tradevolume.toFixed(2),
|
||||||
address: obj.address*/
|
address: obj.address*/
|
||||||
|
|
|
@ -45,7 +45,10 @@ async function main() {
|
||||||
"url": url,
|
"url": url,
|
||||||
"platform": "GiveWell",
|
"platform": "GiveWell",
|
||||||
"description": description,
|
"description": description,
|
||||||
"stars": calculateStars("GiveWell/OpenPhilanthropy", ({})),
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("GiveWell/OpenPhilanthropy", ({})),
|
||||||
|
}
|
||||||
} // Note: This requires some processing afterwards
|
} // Note: This requires some processing afterwards
|
||||||
console.log(result)
|
console.log(result)
|
||||||
results.push(result)
|
results.push(result)
|
||||||
|
|
|
@ -56,7 +56,10 @@ export async function goodjudgment() {
|
||||||
"platform": "Good Judgment",
|
"platform": "Good Judgment",
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": options,
|
"options": options,
|
||||||
"stars": calculateStars("Good Judgment", ({})),
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Good Judgment", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(standardObj)
|
results.push(standardObj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,14 +106,16 @@ async function fetchStats(questionUrl, cookie) {
|
||||||
// Calculate the stars
|
// Calculate the stars
|
||||||
let minProbability = Math.min(...options.map(option => option.probability))
|
let minProbability = Math.min(...options.map(option => option.probability))
|
||||||
let maxProbability = Math.max(...options.map(option => option.probability))
|
let maxProbability = Math.max(...options.map(option => option.probability))
|
||||||
let stars = calculateStars("Good Judgment Open", ({ numforecasts, minProbability, maxProbability }))
|
|
||||||
|
|
||||||
let result = {
|
let result = {
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": options,
|
"options": options,
|
||||||
"numforecasts": numforecasts,
|
"timestamp": new Date().toISOString(),
|
||||||
"numforecasters": numforecasters,
|
"qualityindicators": {
|
||||||
"stars": stars,
|
"numforecasts": numforecasts,
|
||||||
|
"numforecasters": numforecasters,
|
||||||
|
"stars": calculateStars("Good Judgment Open", ({ numforecasts, minProbability, maxProbability }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,11 +138,13 @@ export async function hypermind() {
|
||||||
"title": res.props.title.split("%%fr")[0].replace("%%en:", ""),
|
"title": res.props.title.split("%%fr")[0].replace("%%en:", ""),
|
||||||
"url": "https://predict.hypermind.com/dash/dash/dash.html?list=" + slug,
|
"url": "https://predict.hypermind.com/dash/dash/dash.html?list=" + slug,
|
||||||
"platform": "Hypermind",
|
"platform": "Hypermind",
|
||||||
"options": options,
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"stars": calculateStars("Hypermind", ({})),
|
"options": options,
|
||||||
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Hypermind", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
results1.push(...objs)
|
results1.push(...objs)
|
||||||
}
|
}
|
||||||
|
@ -163,8 +165,9 @@ export async function hypermind() {
|
||||||
"platform": "Hypermind",
|
"platform": "Hypermind",
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": [],
|
"options": [],
|
||||||
"Percentage": "none",
|
"qualityindicators": {
|
||||||
"stars": 3
|
"stars": calculateStars("Hypermind", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -184,7 +187,9 @@ export async function hypermind() {
|
||||||
"platform": "Hypermind",
|
"platform": "Hypermind",
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": [],
|
"options": [],
|
||||||
"stars": 3
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Hypermind", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -200,7 +205,9 @@ export async function hypermind() {
|
||||||
"platform": "Hypermind",
|
"platform": "Hypermind",
|
||||||
"description": description,
|
"description": description,
|
||||||
"options": [],
|
"options": [],
|
||||||
"stars": 3
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Hypermind", ({})),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
13
src/index.js
13
src/index.js
|
@ -54,22 +54,31 @@ let coverttocsvandmerge = async () => {
|
||||||
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")}))
|
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")}))
|
||||||
writefile(JSON.stringify(mergedprocessed, null, 2), "metaforecasts", "", ".json")
|
writefile(JSON.stringify(mergedprocessed, null, 2), "metaforecasts", "", ".json")
|
||||||
|
|
||||||
|
/* Transform into a csv
|
||||||
let preparedforcsv = []
|
let preparedforcsv = []
|
||||||
mergedprocessed.forEach(element => {
|
mergedprocessed.forEach(element => {
|
||||||
preparedforcsv.push({
|
preparedforcsv.push({
|
||||||
"title": element.title,
|
"title": element.title,
|
||||||
"description": element.description,
|
"description": element.description?element.description.replaceAll("\n", " "):"",
|
||||||
"optionsstringforsearch": element.optionsstringforsearch
|
"optionsstringforsearch": element.optionsstringforsearch
|
||||||
})
|
})
|
||||||
} )
|
} )
|
||||||
//console.log(preparedforcsv)
|
//console.log(preparedforcsv)
|
||||||
|
|
||||||
let mergedcsv = csvfromjson(preparedforcsv)
|
let mergedcsv = csvfromjson(preparedforcsv)
|
||||||
writefile(mergedcsv, "metaforecasts", "")
|
writefile(mergedcsv, "metaforecasts", "")
|
||||||
|
*/
|
||||||
|
|
||||||
console.log("Done")
|
console.log("Done")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let addtohistory = () => {
|
||||||
|
let currentJSON = fs.readFileSync(locationData + "metaforecasts.json")
|
||||||
|
let historyJSON = fs.readFileSync(locationData + "metaforecasts_history_bootstrap.json")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async function whattodo(message,callback){
|
async function whattodo(message,callback){
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
input: process.stdin,
|
input: process.stdin,
|
||||||
|
|
|
@ -56,7 +56,6 @@ let processResults = async (json) => {
|
||||||
"name":name,
|
"name":name,
|
||||||
"probability": probability,
|
"probability": probability,
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
|
|
||||||
})
|
})
|
||||||
return option
|
return option
|
||||||
})
|
})
|
||||||
|
@ -76,8 +75,12 @@ let processResults = async (json) => {
|
||||||
"title": title,
|
"title": title,
|
||||||
"url": "https://sports.ladbrokes.com/sport/politics/outrights",
|
"url": "https://sports.ladbrokes.com/sport/politics/outrights",
|
||||||
"platform": "Ladbrokes",
|
"platform": "Ladbrokes",
|
||||||
|
"description": "",
|
||||||
"options": options,
|
"options": options,
|
||||||
"stars": calculateStars("Ladbrokes", ({}))
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Ladbrokes", ({}))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(obj)
|
results.push(obj)
|
||||||
}
|
}
|
||||||
|
@ -109,12 +112,14 @@ let processResults = async (json) => {
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stars": calculateStars("Ladbrokes", ({}))
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Ladbrokes", ({}))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(obj)
|
results.push(obj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Body */
|
/* Body */
|
||||||
|
|
|
@ -104,16 +104,18 @@ export async function metaculus() {
|
||||||
"title": result.title,
|
"title": result.title,
|
||||||
"url": "https://www.metaculus.com" + result.page_url,
|
"url": "https://www.metaculus.com" + result.page_url,
|
||||||
"platform": "Metaculus",
|
"platform": "Metaculus",
|
||||||
"options": options,
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"numforecasts": result.number_of_predictions,
|
"options": options,
|
||||||
"stars": calculateStars("Metaculus", ({ numforecasts: result.number_of_predictions })),
|
"timestamp": new Date().toISOString(),
|
||||||
"resolution_data": {
|
"qualityindicators": {
|
||||||
"publish_time": result.publish_time,
|
"numforecasts": result.number_of_predictions,
|
||||||
"resolution": result.resolution,
|
"resolution_data": {
|
||||||
"close_time": result.close_time,
|
"publish_time": result.publish_time,
|
||||||
"resolve_time": result.resolve_time
|
"resolution": result.resolution,
|
||||||
|
"close_time": result.close_time,
|
||||||
|
"resolve_time": result.resolve_time
|
||||||
|
},
|
||||||
|
"stars": calculateStars("Metaculus", ({ numforecasts: result.number_of_predictions }))
|
||||||
}
|
}
|
||||||
//"status": result.status,
|
//"status": result.status,
|
||||||
//"publish_time": result.publish_time,
|
//"publish_time": result.publish_time,
|
||||||
|
|
|
@ -27,11 +27,14 @@ for(let datum of data){
|
||||||
"probability": 1-Math.round(probability*100)/100,
|
"probability": 1-Math.round(probability*100)/100,
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stars": datum["Stars"]
|
"timestamp": "2021-02-23T15∶21∶37.005Z",//new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": datum["Stars"]
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(result)
|
results.push(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
let string = JSON.stringify(results,null, 2)
|
let string = JSON.stringify(results,null, 2)
|
||||||
fs.writeFileSync("../data/givewellopenphil-questions.json", string)
|
fs.writeFileSync("../data/givewellopenphil-questions-new.json", string)
|
||||||
|
|
|
@ -33,10 +33,13 @@ ${datum["description"]}` : datum["description"]
|
||||||
"type": "PROBABILITY"
|
"type": "PROBABILITY"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stars": 2
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": 2//datum["stars"]
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(result)
|
results.push(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
let string = JSON.stringify(results,null, 2)
|
let string = JSON.stringify(results,null, 2)
|
||||||
fs.writeFileSync("/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current/data/xrisk-questions.json", string)
|
fs.writeFileSync("/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current/data/xrisk-questions-new.json", string)
|
||||||
|
|
|
@ -69,9 +69,12 @@ async function fetch_all() {
|
||||||
"title": data.question.title,
|
"title": data.question.title,
|
||||||
"url": "https://omen.eth.link/#/" + data.id,
|
"url": "https://omen.eth.link/#/" + data.id,
|
||||||
"platform": "Omen",
|
"platform": "Omen",
|
||||||
"options": options,
|
|
||||||
"description": "",
|
"description": "",
|
||||||
"stars": calculateStars("Omen", ({}))
|
"options": options,
|
||||||
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Omen", ({}))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log(obj)
|
console.log(obj)
|
||||||
results.push(obj)
|
results.push(obj)
|
||||||
|
|
|
@ -107,11 +107,16 @@ async function fetch_all() {
|
||||||
"platform": "PolyMarket",
|
"platform": "PolyMarket",
|
||||||
"description": obj.description,
|
"description": obj.description,
|
||||||
"options": options,
|
"options": options,
|
||||||
"numforecasts": Number(data.tradesQuantity).toFixed(0),
|
"timestamp": new Date().toISOString(),
|
||||||
"stars": calculateStars("Polymarket", ({ liquidity, option: options[0] }))
|
"qualityindicators": {
|
||||||
/*liquidity: liquidity.toFixed(2),
|
"numforecasts": Number(data.tradesQuantity).toFixed(0),
|
||||||
tradevolume: tradevolume.toFixed(2),
|
"liquidity": liquidity.toFixed(2),
|
||||||
address: obj.address*/
|
"tradevolume": tradevolume.toFixed(2),
|
||||||
|
"stars": calculateStars("Polymarket", ({ liquidity, option: options[0] }))
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
address: obj.address
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,9 +75,13 @@ export async function predictit() {
|
||||||
"title": market["name"],
|
"title": market["name"],
|
||||||
"url": market.url,
|
"url": market.url,
|
||||||
"platform": "PredictIt",
|
"platform": "PredictIt",
|
||||||
"options": options,
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"stars": calculateStars("PredictIt", ({}))
|
"options": options,
|
||||||
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("PredictIt", ({}))
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
console.log(obj)
|
console.log(obj)
|
||||||
result.push(obj)
|
result.push(obj)
|
||||||
|
|
|
@ -137,9 +137,13 @@ export async function smarkets() {
|
||||||
"title": name,
|
"title": name,
|
||||||
"url": "https://smarkets.com/event/" + market.event_id + market.slug,
|
"url": "https://smarkets.com/event/" + market.event_id + market.slug,
|
||||||
"platform": "Smarkets",
|
"platform": "Smarkets",
|
||||||
"options": options,
|
|
||||||
"description": market.description,
|
"description": market.description,
|
||||||
"stars": calculateStars("Smarkets", ({}))
|
"options": options,
|
||||||
|
"timestamp": new Date().toISOString(),
|
||||||
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("Smarkets", ({}))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//console.log(result)
|
//console.log(result)
|
||||||
results.push(result)
|
results.push(result)
|
||||||
|
|
|
@ -46,6 +46,8 @@ let processResults = (html) => {
|
||||||
"title": title,
|
"title": title,
|
||||||
"url": "https://sports.williamhill.com/betting/en-gb/politics",
|
"url": "https://sports.williamhill.com/betting/en-gb/politics",
|
||||||
"platform": "WilliamHill",
|
"platform": "WilliamHill",
|
||||||
|
"description": "",
|
||||||
|
"timestamp": new Date().toISOString(),
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
"name": "Yes",
|
"name": "Yes",
|
||||||
|
@ -101,7 +103,9 @@ let processResults = (html) => {
|
||||||
"url": "https://sports.williamhill.com/betting/en-gb/politics",
|
"url": "https://sports.williamhill.com/betting/en-gb/politics",
|
||||||
"platform": "WilliamHill",
|
"platform": "WilliamHill",
|
||||||
"options": options,
|
"options": options,
|
||||||
"stars": calculateStars("WilliamHill", ({}))
|
"qualityindicators": {
|
||||||
|
"stars": calculateStars("WilliamHill", ({}))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
results.push(obj)
|
results.push(obj)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user