Added netlify hook
This commit is contained in:
parent
d15a234399
commit
b86d95778c
|
@ -18,20 +18,19 @@ import {smarkets} from "./platforms/smarkets-fetch.js"
|
|||
import {williamhill} from "./platforms/williamhill-fetch.js"
|
||||
|
||||
import {mergeEverything} from "./utils/mergeEverything.js"
|
||||
import {rebuildNetlifySiteWithNewData} from "./utils/rebuildNetliftySiteWithNewData.js"
|
||||
import {doEverything, tryCatchTryAgain} from "./utils/doEverything.js"
|
||||
|
||||
/* Definitions */
|
||||
|
||||
|
||||
/* Support functions */
|
||||
let functions = [csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, mergeEverything, doEverything]
|
||||
let functions = [csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, mergeEverything, rebuildNetlifySiteWithNewData, doEverything]
|
||||
let functionNames = functions.map(fun => fun.name)
|
||||
|
||||
let whattodoMessage = functionNames
|
||||
.slice(0,functionNames.length-2)
|
||||
.map((functionName,i) => `[${i}]: Download predictions from ${functionName}`)
|
||||
.join('\n') +
|
||||
`\n[${functionNames.length-2}]: Merge jsons them into one big json` +
|
||||
`\n[${functionNames.length-3}]: Merge jsons them into one big json (and push it to mongodb database)` +
|
||||
`\n[${functionNames.length-2}]: Rebuild netlify site with new data` +
|
||||
// `\n[${functionNames.length-1}]: Add to history` +
|
||||
`\n[${functionNames.length-1}]: All of the above` +
|
||||
`\nChoose one option, wisely: #`
|
||||
|
|
|
@ -13,7 +13,7 @@ import {predictit} from "../platforms/predictit-fetch.js"
|
|||
import {omen} from "../platforms/omen-fetch.js"
|
||||
import {smarkets} from "../platforms/smarkets-fetch.js"
|
||||
import {williamhill} from "../platforms/williamhill-fetch.js"
|
||||
|
||||
import {rebuildNetlifySiteWithNewData} from "./rebuildNetliftySiteWithNewData.js"
|
||||
import {mergeEverything} from "./mergeEverything.js"
|
||||
|
||||
/* Do everything */
|
||||
|
@ -33,7 +33,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]
|
||||
let functions = [csetforetell, elicit, /* estimize, */ fantasyscotus, foretold, goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, mergeEverything, rebuildNetlifySiteWithNewData]
|
||||
|
||||
console.log("")
|
||||
console.log("")
|
||||
|
|
9
src/utils/rebuildNetliftySiteWithNewData.js
Normal file
9
src/utils/rebuildNetliftySiteWithNewData.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
import axios from "axios"
|
||||
|
||||
export async function rebuildNetlifySiteWithNewData(){
|
||||
let rebuildNetlifyHookUrl = process.env.REBUIDNETLIFYHOOKURL;
|
||||
let payload = ({});
|
||||
let response = await axios.post(rebuildNetlifyHookUrl, payload);
|
||||
let data = response.data;
|
||||
console.log(data);
|
||||
}
|
Loading…
Reference in New Issue
Block a user