fix: Added more detection of whether I'm not logged in to CSET-foretell; it turns out that the first page of questions is shown even if not logged in.
This commit is contained in:
parent
c46c0242a2
commit
87db98ec45
|
@ -45,6 +45,10 @@ async function fetchStats(questionUrl, cookie){
|
|||
.then(res => res.data)
|
||||
//console.log(response)
|
||||
|
||||
if(response.includes("Sign up or sign in to forecast")){
|
||||
throw Error("Not logged in")
|
||||
}
|
||||
|
||||
// Is binary?
|
||||
let isbinary = response.includes("binary?":true")
|
||||
// console.log(`is binary? ${isbinary}`)
|
||||
|
@ -104,6 +108,8 @@ async function fetchStats(questionUrl, cookie){
|
|||
let description = descriptionprocessed8
|
||||
|
||||
// Number of forecasts
|
||||
console.log(response)
|
||||
console.log(response.split("prediction_sets_count":")[1])
|
||||
let numforecasts = response.split("prediction_sets_count":")[1].split(",")[0]
|
||||
// console.log(numforecasts)
|
||||
|
||||
|
|
|
@ -108,6 +108,9 @@ async function fetchStats(questionUrl, cookie) {
|
|||
}
|
||||
|
||||
function isEnd(html) {
|
||||
if(html.includes("You need to sign in or sign up before continuing")){
|
||||
throw Error("You need to sign in or sign up before continuing")
|
||||
}
|
||||
return html.includes("No questions match your filter")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user