feat: Added Betfair

This commit is contained in:
NunoSempere 2021-08-01 01:55:08 +02:00
parent d3d41d94e1
commit 66b024bd38
10 changed files with 38618 additions and 226 deletions

2
.gitignore vendored
View File

@ -4,4 +4,4 @@ node_modules/
**/privatekeys.json **/privatekeys.json
possiblenewsources.md possiblenewsources.md
herokulocation.md NotesHeroku.md

155
node_modules/.package-lock.json generated vendored
View File

@ -120,32 +120,38 @@
} }
}, },
"node_modules/cheerio": { "node_modules/cheerio": {
"version": "1.0.0-rc.5", "version": "1.0.0-rc.10",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.5.tgz", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz",
"integrity": "sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw==", "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==",
"dependencies": { "dependencies": {
"cheerio-select-tmp": "^0.1.0", "cheerio-select": "^1.5.0",
"dom-serializer": "~1.2.0", "dom-serializer": "^1.3.2",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "~2.1.0", "htmlparser2": "^6.1.0",
"htmlparser2": "^6.0.0", "parse5": "^6.0.1",
"parse5": "^6.0.0", "parse5-htmlparser2-tree-adapter": "^6.0.1",
"parse5-htmlparser2-tree-adapter": "^6.0.0" "tslib": "^2.2.0"
}, },
"engines": { "engines": {
"node": ">= 0.12" "node": ">= 6"
},
"funding": {
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
} }
}, },
"node_modules/cheerio-select-tmp": { "node_modules/cheerio-select": {
"version": "0.1.1", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz",
"integrity": "sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ==", "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==",
"dependencies": { "dependencies": {
"css-select": "^3.1.2", "css-select": "^4.1.3",
"css-what": "^4.0.0", "css-what": "^5.0.1",
"domelementtype": "^2.1.0", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.4" "domutils": "^2.7.0"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/clone-response": { "node_modules/clone-response": {
@ -178,23 +184,29 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
}, },
"node_modules/css-select": { "node_modules/css-select": {
"version": "3.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz",
"integrity": "sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==", "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==",
"dependencies": { "dependencies": {
"boolbase": "^1.0.0", "boolbase": "^1.0.0",
"css-what": "^4.0.0", "css-what": "^5.0.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.3", "domutils": "^2.6.0",
"nth-check": "^2.0.0" "nth-check": "^2.0.0"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/css-what": { "node_modules/css-what": {
"version": "4.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz", "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz",
"integrity": "sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==", "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==",
"engines": { "engines": {
"node": ">= 6" "node": ">= 6"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/decompress-response": { "node_modules/decompress-response": {
@ -225,39 +237,54 @@
} }
}, },
"node_modules/dom-serializer": { "node_modules/dom-serializer": {
"version": "1.2.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
"integrity": "sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==", "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
"dependencies": { "dependencies": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "^2.0.0" "entities": "^2.0.0"
},
"funding": {
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
} }
}, },
"node_modules/domelementtype": { "node_modules/domelementtype": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==" "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
]
}, },
"node_modules/domhandler": { "node_modules/domhandler": {
"version": "4.0.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
"integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
"dependencies": { "dependencies": {
"domelementtype": "^2.1.0" "domelementtype": "^2.2.0"
}, },
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
} }
}, },
"node_modules/domutils": { "node_modules/domutils": {
"version": "2.4.4", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz",
"integrity": "sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA==", "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==",
"dependencies": { "dependencies": {
"dom-serializer": "^1.0.1", "dom-serializer": "^1.0.1",
"domelementtype": "^2.0.1", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0" "domhandler": "^4.2.0"
},
"funding": {
"url": "https://github.com/fb55/domutils?sponsor=1"
} }
}, },
"node_modules/duplexer3": { "node_modules/duplexer3": {
@ -274,9 +301,12 @@
} }
}, },
"node_modules/entities": { "node_modules/entities": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.13.1", "version": "1.13.1",
@ -328,13 +358,20 @@
} }
}, },
"node_modules/htmlparser2": { "node_modules/htmlparser2": {
"version": "6.0.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.0.tgz", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
"integrity": "sha512-numTQtDZMoh78zJpaNdJ9MXb2cv5G3jwUoe3dMQODubZvLoGvTE/Ofp6sHvH8OGKcN/8A47pGLi/k58xHP/Tfw==", "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
"funding": [
"https://github.com/fb55/htmlparser2?sponsor=1",
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"dependencies": { "dependencies": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.0.0",
"domutils": "^2.4.4", "domutils": "^2.5.2",
"entities": "^2.0.0" "entities": "^2.0.0"
} }
}, },
@ -501,9 +538,9 @@
} }
}, },
"node_modules/normalize-url": { "node_modules/normalize-url": {
"version": "4.5.0", "version": "4.5.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
"engines": { "engines": {
"node": ">=8" "node": ">=8"
} }
@ -514,6 +551,9 @@
"integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==",
"dependencies": { "dependencies": {
"boolbase": "^1.0.0" "boolbase": "^1.0.0"
},
"funding": {
"url": "https://github.com/fb55/nth-check?sponsor=1"
} }
}, },
"node_modules/once": { "node_modules/once": {
@ -720,6 +760,11 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"node_modules/tunnel": { "node_modules/tunnel": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",

268
package-lock.json generated
View File

@ -137,32 +137,38 @@
} }
}, },
"node_modules/cheerio": { "node_modules/cheerio": {
"version": "1.0.0-rc.5", "version": "1.0.0-rc.10",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.5.tgz", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz",
"integrity": "sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw==", "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==",
"dependencies": { "dependencies": {
"cheerio-select-tmp": "^0.1.0", "cheerio-select": "^1.5.0",
"dom-serializer": "~1.2.0", "dom-serializer": "^1.3.2",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "~2.1.0", "htmlparser2": "^6.1.0",
"htmlparser2": "^6.0.0", "parse5": "^6.0.1",
"parse5": "^6.0.0", "parse5-htmlparser2-tree-adapter": "^6.0.1",
"parse5-htmlparser2-tree-adapter": "^6.0.0" "tslib": "^2.2.0"
}, },
"engines": { "engines": {
"node": ">= 0.12" "node": ">= 6"
},
"funding": {
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
} }
}, },
"node_modules/cheerio-select-tmp": { "node_modules/cheerio-select": {
"version": "0.1.1", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz",
"integrity": "sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ==", "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==",
"dependencies": { "dependencies": {
"css-select": "^3.1.2", "css-select": "^4.1.3",
"css-what": "^4.0.0", "css-what": "^5.0.1",
"domelementtype": "^2.1.0", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.4" "domutils": "^2.7.0"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/clone-response": { "node_modules/clone-response": {
@ -195,23 +201,29 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
}, },
"node_modules/css-select": { "node_modules/css-select": {
"version": "3.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz",
"integrity": "sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==", "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==",
"dependencies": { "dependencies": {
"boolbase": "^1.0.0", "boolbase": "^1.0.0",
"css-what": "^4.0.0", "css-what": "^5.0.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.3", "domutils": "^2.6.0",
"nth-check": "^2.0.0" "nth-check": "^2.0.0"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/css-what": { "node_modules/css-what": {
"version": "4.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz", "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz",
"integrity": "sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==", "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==",
"engines": { "engines": {
"node": ">= 6" "node": ">= 6"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/decompress-response": { "node_modules/decompress-response": {
@ -242,39 +254,54 @@
} }
}, },
"node_modules/dom-serializer": { "node_modules/dom-serializer": {
"version": "1.2.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
"integrity": "sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==", "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
"dependencies": { "dependencies": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "^2.0.0" "entities": "^2.0.0"
},
"funding": {
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
} }
}, },
"node_modules/domelementtype": { "node_modules/domelementtype": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==" "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
]
}, },
"node_modules/domhandler": { "node_modules/domhandler": {
"version": "4.0.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
"integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
"dependencies": { "dependencies": {
"domelementtype": "^2.1.0" "domelementtype": "^2.2.0"
}, },
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
} }
}, },
"node_modules/domutils": { "node_modules/domutils": {
"version": "2.4.4", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz",
"integrity": "sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA==", "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==",
"dependencies": { "dependencies": {
"dom-serializer": "^1.0.1", "dom-serializer": "^1.0.1",
"domelementtype": "^2.0.1", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0" "domhandler": "^4.2.0"
},
"funding": {
"url": "https://github.com/fb55/domutils?sponsor=1"
} }
}, },
"node_modules/duplexer3": { "node_modules/duplexer3": {
@ -291,9 +318,12 @@
} }
}, },
"node_modules/entities": { "node_modules/entities": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.13.1", "version": "1.13.1",
@ -345,13 +375,20 @@
} }
}, },
"node_modules/htmlparser2": { "node_modules/htmlparser2": {
"version": "6.0.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.0.tgz", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
"integrity": "sha512-numTQtDZMoh78zJpaNdJ9MXb2cv5G3jwUoe3dMQODubZvLoGvTE/Ofp6sHvH8OGKcN/8A47pGLi/k58xHP/Tfw==", "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
"funding": [
"https://github.com/fb55/htmlparser2?sponsor=1",
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"dependencies": { "dependencies": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.0.0",
"domutils": "^2.4.4", "domutils": "^2.5.2",
"entities": "^2.0.0" "entities": "^2.0.0"
} }
}, },
@ -518,9 +555,9 @@
} }
}, },
"node_modules/normalize-url": { "node_modules/normalize-url": {
"version": "4.5.0", "version": "4.5.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
"engines": { "engines": {
"node": ">=8" "node": ">=8"
} }
@ -531,6 +568,9 @@
"integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==",
"dependencies": { "dependencies": {
"boolbase": "^1.0.0" "boolbase": "^1.0.0"
},
"funding": {
"url": "https://github.com/fb55/nth-check?sponsor=1"
} }
}, },
"node_modules/once": { "node_modules/once": {
@ -737,6 +777,11 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"node_modules/tunnel": { "node_modules/tunnel": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
@ -871,29 +916,29 @@
} }
}, },
"cheerio": { "cheerio": {
"version": "1.0.0-rc.5", "version": "1.0.0-rc.10",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.5.tgz", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz",
"integrity": "sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw==", "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==",
"requires": { "requires": {
"cheerio-select-tmp": "^0.1.0", "cheerio-select": "^1.5.0",
"dom-serializer": "~1.2.0", "dom-serializer": "^1.3.2",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "~2.1.0", "htmlparser2": "^6.1.0",
"htmlparser2": "^6.0.0", "parse5": "^6.0.1",
"parse5": "^6.0.0", "parse5-htmlparser2-tree-adapter": "^6.0.1",
"parse5-htmlparser2-tree-adapter": "^6.0.0" "tslib": "^2.2.0"
} }
}, },
"cheerio-select-tmp": { "cheerio-select": {
"version": "0.1.1", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz",
"integrity": "sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ==", "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==",
"requires": { "requires": {
"css-select": "^3.1.2", "css-select": "^4.1.3",
"css-what": "^4.0.0", "css-what": "^5.0.1",
"domelementtype": "^2.1.0", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.4" "domutils": "^2.7.0"
} }
}, },
"clone-response": { "clone-response": {
@ -922,21 +967,21 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
}, },
"css-select": { "css-select": {
"version": "3.1.2", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz",
"integrity": "sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==", "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==",
"requires": { "requires": {
"boolbase": "^1.0.0", "boolbase": "^1.0.0",
"css-what": "^4.0.0", "css-what": "^5.0.0",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"domutils": "^2.4.3", "domutils": "^2.6.0",
"nth-check": "^2.0.0" "nth-check": "^2.0.0"
} }
}, },
"css-what": { "css-what": {
"version": "4.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz", "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz",
"integrity": "sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==" "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg=="
}, },
"decompress-response": { "decompress-response": {
"version": "5.0.0", "version": "5.0.0",
@ -957,36 +1002,36 @@
"integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ=="
}, },
"dom-serializer": { "dom-serializer": {
"version": "1.2.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
"integrity": "sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==", "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
"requires": { "requires": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.2.0",
"entities": "^2.0.0" "entities": "^2.0.0"
} }
}, },
"domelementtype": { "domelementtype": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==" "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A=="
}, },
"domhandler": { "domhandler": {
"version": "4.0.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
"integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
"requires": { "requires": {
"domelementtype": "^2.1.0" "domelementtype": "^2.2.0"
} }
}, },
"domutils": { "domutils": {
"version": "2.4.4", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz",
"integrity": "sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA==", "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==",
"requires": { "requires": {
"dom-serializer": "^1.0.1", "dom-serializer": "^1.0.1",
"domelementtype": "^2.0.1", "domelementtype": "^2.2.0",
"domhandler": "^4.0.0" "domhandler": "^4.2.0"
} }
}, },
"duplexer3": { "duplexer3": {
@ -1003,9 +1048,9 @@
} }
}, },
"entities": { "entities": {
"version": "2.1.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.13.1", "version": "1.13.1",
@ -1048,13 +1093,13 @@
} }
}, },
"htmlparser2": { "htmlparser2": {
"version": "6.0.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.0.tgz", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
"integrity": "sha512-numTQtDZMoh78zJpaNdJ9MXb2cv5G3jwUoe3dMQODubZvLoGvTE/Ofp6sHvH8OGKcN/8A47pGLi/k58xHP/Tfw==", "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
"requires": { "requires": {
"domelementtype": "^2.0.1", "domelementtype": "^2.0.1",
"domhandler": "^4.0.0", "domhandler": "^4.0.0",
"domutils": "^2.4.4", "domutils": "^2.5.2",
"entities": "^2.0.0" "entities": "^2.0.0"
} }
}, },
@ -1168,9 +1213,9 @@
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
}, },
"normalize-url": { "normalize-url": {
"version": "4.5.0", "version": "4.5.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA=="
}, },
"nth-check": { "nth-check": {
"version": "2.0.0", "version": "2.0.0",
@ -1347,6 +1392,11 @@
"resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-2.1.0.tgz", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-2.1.0.tgz",
"integrity": "sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w==" "integrity": "sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w=="
}, },
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"tunnel": { "tunnel": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",

View File

@ -3,6 +3,7 @@ import fs from 'fs'
import readline from "readline" import readline from "readline"
import {astralcodexten} from "./platforms/astralcodexten-fetch.js" import {astralcodexten} from "./platforms/astralcodexten-fetch.js"
import {betfair} from "./platforms/betfair-fetch.js"
import {coupcast} from "./platforms/coupcast-fetch.js" import {coupcast} from "./platforms/coupcast-fetch.js"
import {csetforetell} from "./platforms/csetforetell-fetch.js" import {csetforetell} from "./platforms/csetforetell-fetch.js"
import {elicit} from "./platforms/elicit-fetch.js" import {elicit} from "./platforms/elicit-fetch.js"
@ -27,7 +28,7 @@ import {rebuildNetlifySiteWithNewData} from "./utils/rebuildNetliftySiteWithNewD
import {doEverything, tryCatchTryAgain} from "./utils/doEverything.js" import {doEverything, tryCatchTryAgain} from "./utils/doEverything.js"
/* Support functions */ /* Support functions */
let functions = [astralcodexten, coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, kalshi, ladbrokes, metaculus, omen, polymarket, predictit, rootclaim, smarkets, williamhill, mergeEverything, updateHistory, rebuildNetlifySiteWithNewData, doEverything] let functions = [astralcodexten, betfair, coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, kalshi, ladbrokes, metaculus, omen, polymarket, predictit, rootclaim, smarkets, williamhill, mergeEverything, updateHistory, rebuildNetlifySiteWithNewData, doEverything]
let functionNames = functions.map(fun => fun.name) let functionNames = functions.map(fun => fun.name)
let whattodoMessage = functionNames let whattodoMessage = functionNames

View File

@ -9,26 +9,7 @@ import {upsert} from "../utils/mongo-wrapper.js"
/* Definitions */ /* Definitions */
let endpoint = process.env.SECRET_BETFAIR_ENDPOINT let endpoint = process.env.SECRET_BETFAIR_ENDPOINT
/* Support functions */ /* Utilities */
async function fetchPredictions() {
const agent = new https.Agent({
rejectUnauthorized: false
});
let response = await axios({
url: endpoint,
method: 'GET',
headers: ({
'Content-Type': 'text/html',
}),
httpsAgent: agent
})
.then(response => response.data)
// console.log(response)
return response
}
async function whipIntoShape(data){
let arraysEqual = (a, b) => { let arraysEqual = (a, b) => {
if (a === b) return true; if (a === b) return true;
if (a == null || b == null) return false; if (a == null || b == null) return false;
@ -44,53 +25,98 @@ async function whipIntoShape(data){
} }
return true; return true;
} }
let mergeRunners = (runnerCatalog, runnerBook) => {
let keys = Object.keys(runnerCatalog)
let result = []
for(let key of keys){
result.push({...runnerCatalog[key], ...runnerBook[key]})
}
return result
}
/* Support functions */
async function fetchPredictions() {
const agent = new https.Agent({
rejectUnauthorized: false
});
let response = await axios({
url: endpoint,
method: 'GET',
headers: ({
'Content-Type': 'text/html',
}),
httpsAgent: agent
}).then(response => response.data)
return response
}
async function whipIntoShape(data){
let catalogues = data.market_catalogues let catalogues = data.market_catalogues
let books = data.market_books let books = data.market_books
let keys1 = Object.keys(catalogues) let keys1 = Object.keys(catalogues).sort()
let keys2 = Object.keys(books) let keys2 = Object.keys(books).sort()
let results = ({}) // console.log(keys1)
// console.log(keys2)
let results = []
if(!arraysEqual(keys1, keys2)){ if(!arraysEqual(keys1, keys2)){
throw new Error("Betfair: Error in endpoint; Betfair catalogues and books do not match") throw new Error("Betfair: Error in endpoint; Betfair catalogues and books do not match")
}else{ }else{
for(catalogue in catalogues){ for(let key of keys1){
console.log(catalogue) results.push({...catalogues[key], ...books[key], options: mergeRunners(catalogues[key].runners, books[key].runners)})
}
for(book in books){
console.log(book)
} }
} }
return results return results
} }
async function processPredictions(data) {
async function processPredictions(predictions) { let predictions = await whipIntoShape(data)
console.log(JSON.stringify(predictions, null, 4))
let results = await predictions.map(prediction => { let results = predictions.map(prediction => {
let probability = prediction.probability let normalizationFactor = (prediction.options
let options = [ .filter(option => option.status == "ACTIVE" && option.totalMatched > 0)
{ .map(option => option.lastPriceTraded))
"name": "Yes", .map(x => 1/x)
"probability": probability, .reduce((a, b) => a + b, 0)
"type": "PROBABILITY" let options = prediction.options
}, .filter(option => option.status == "ACTIVE" && option.totalMatched > 0)
{ .map(option => ({
"name": "No", "name": option.runnerName,
"probability": 1 - probability, "probability": option.lastPriceTraded !=0 ? (1/option.lastPriceTraded)/normalizationFactor : 0, // https://www.aceodds.com/bet-calculator/odds-converter.html
"type": "PROBABILITY" "type": "PROBABILITY"
}))
// console.log(prediction.options)
let rules = prediction.description.rules
.split("Regs</a>.")[1]
.replace(/<br><br>/g, " ")
.replace(/<br>/g, " ")
.replace(/<b>/g, " ")
.replace(/<\/b>/g, " ")
.replace(/\n/g, " ")
.trim()
if(rules == undefined){
console.log(prediction.description)
}
let title = rules.split("? ")[0] + "?"
let description = rules.split("? ")[1].trim()
if(title.includes("of the named")){
title = prediction.marketName + ": "+ title
} }
]
let result = ({ let result = ({
"title": prediction.title, "title": title,
"url": `https://example.com`, "url": `https://betfair.com`,
"platform": "Example", "platform": "Betfair",
"description": prediction.description, "description": description,
"options": options, "options": options,
"timestamp": new Date().toISOString(), "timestamp": new Date().toISOString(),
"qualityindicators": { "qualityindicators": {
"stars": calculateStars("Example", ({some: somex, factors: factors})), "stars": calculateStars("Betfair", ({volume: prediction.totalMatched})),
"other": prediction.otherx, "volume": prediction.totalMatched,
"indicators": prediction.indicatorx
} }
}) })
return result return result
@ -101,13 +127,12 @@ async function processPredictions(predictions) {
/* Body */ /* Body */
export async function betfair() { export async function betfair() {
let predictions = await fetchPredictions() let data = await fetchPredictions()
whipIntoShape(predictions) let results = await processPredictions(data) // somehow needed
let results = await processPredictions(predictions) // somehow needed // console.log(results.map(result => ({title: result.title, description: result.description})))
// console.log(results)
// let string = JSON.stringify(results, null, 2) // let string = JSON.stringify(results, null, 2)
// fs.writeFileSync('polyprediction-questions.json', string); // fs.writeFileSync('polyprediction-questions.json', string);
// await upsert(results, "example-questions") await upsert(results, "betfair-questions")
console.log("Done") console.log("Done")
} }
betfair() // betfair()

View File

@ -10,7 +10,7 @@ let endpoint = 'https://example.com/'
/* Support functions */ /* Support functions */
async function fetchPredictions() { async function fetchData() {
let response = await axios({ let response = await axios({
url: endpoint, url: endpoint,
method: 'GET', method: 'GET',
@ -59,8 +59,8 @@ async function processPredictions(predictions) {
/* Body */ /* Body */
export async function example() { export async function example() {
let predictions = await fetchPredictions() let data = await fetchData()
let results = await processPredictions(predictions) // somehow needed let results = await processPredictions(data) // somehow needed
// console.log(results) // console.log(results)
// let string = JSON.stringify(results, null, 2) // let string = JSON.stringify(results, null, 2)
// fs.writeFileSync('polyprediction-questions.json', string); // fs.writeFileSync('polyprediction-questions.json', string);

View File

@ -1,4 +1,5 @@
import {astralcodexten} from "../platforms/astralcodexten-fetch.js" import {astralcodexten} from "../platforms/astralcodexten-fetch.js"
import {betfair} from "../platforms/betfair-fetch.js"
import {coupcast} from "../platforms/coupcast-fetch.js" import {coupcast} from "../platforms/coupcast-fetch.js"
import {csetforetell} from "../platforms/csetforetell-fetch.js" import {csetforetell} from "../platforms/csetforetell-fetch.js"
import {elicit} from "../platforms/elicit-fetch.js" import {elicit} from "../platforms/elicit-fetch.js"
@ -38,7 +39,7 @@ export async function tryCatchTryAgain (fun) {
} }
} }
export async function doEverything(){ export async function doEverything(){
let functions = [coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, /* goodjudgment, */ goodjudgmentopen, hypermind, ladbrokes, kalshi, metaculus, omen, polymarket, predictit, rootclaim, smarkets, williamhill, mergeEverything, updateHistory, rebuildNetlifySiteWithNewData] let functions = [betfair, coupcast, csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, /* goodjudgment, */ goodjudgmentopen, hypermind, ladbrokes, kalshi, metaculus, omen, polymarket, predictit, rootclaim, smarkets, williamhill, mergeEverything, updateHistory, rebuildNetlifySiteWithNewData]
// Removed Good Judgment from the fetcher, doing it using cron instead because cloudflare blocks the utility on heroku. // Removed Good Judgment from the fetcher, doing it using cron instead because cloudflare blocks the utility on heroku.
console.log("") console.log("")

View File

@ -1,7 +1,7 @@
import { mongoRead, upsert } from "./mongo-wrapper.js" import { mongoRead, upsert } from "./mongo-wrapper.js"
/* Merge everything */ /* Merge everything */
let sets = ["astralcodexten","coupcast", "csetforetell", "elicit", "estimize", "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "kalshi", "ladbrokes", "metaculus", "omen", "polymarket", "predictit", "rootclaim", "smarkets", "williamhill", "xrisk"] let sets = ["astralcodexten", "betfair", "coupcast", "csetforetell", "elicit", "estimize", "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "kalshi", "ladbrokes", "metaculus", "omen", "polymarket", "predictit", "rootclaim", "smarkets", "williamhill", "xrisk"]
let suffix = "-questions" let suffix = "-questions"
export async function mergeEverything(){ export async function mergeEverything(){

View File

@ -36,6 +36,22 @@ function calculateStarsAstralCodexTen(data) {
return starsInteger return starsInteger
} }
function calculateStarsBetfair(data) {
let nuno = data => data.volume > 1000 ? 3 : 2
let eli = (data) => data.volume > 10000 ? 5 : 4
let misha = (data) => 3.5
let starsDecimal = average([nuno(data), eli(data), misha(data)])
// Substract 1 star if probability is above 90% or below 10%
if(data.option &&
(data.option.probability < 0.1 || data.option.probability > 0.9)
){
starsDecimal = starsDecimal - 1
}
let starsInteger = Math.round(starsDecimal)
return starsInteger
}
function calculateStarsCoupCast(data) { function calculateStarsCoupCast(data) {
let nuno = (data) => 3 let nuno = (data) => 3
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)])
@ -216,6 +232,9 @@ export function calculateStars(platform, data) {
case "AstralCodexTen": case "AstralCodexTen":
stars = calculateStarsAstralCodexTen(data) stars = calculateStarsAstralCodexTen(data)
break; break;
case "Betfair":
stars = calculateStarsBetfair(data)
break;
case "CoupCast": case "CoupCast":
stars = calculateStarsCoupCast(data) stars = calculateStarsCoupCast(data)
break; break;

38251
temp.txt Normal file

File diff suppressed because it is too large Load Diff