Daily commit
This commit is contained in:
		
							parent
							
								
									8fd0230bd4
								
							
						
					
					
						commit
						4598ae7fbc
					
				
							
								
								
									
										1122
									
								
								data/fantasyscotus-questions.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1122
									
								
								data/fantasyscotus-questions.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -910,6 +910,62 @@ http://www.pewforum.org/2015/05/12/americas-changing-religious-landscape/",,"Yes | |||
| "Estimates for Zimmer Biomet (ZBH)","A link to Estimize's forecasts for *Zimmer Biomet* (sticker symbol ZBH). Viewing them requires making a prediction, Wall Street estimates are provided for free","" | ||||
| "Estimates for Zions Bancorp (ZION)","A link to Estimize's forecasts for *Zions Bancorp* (sticker symbol ZION). Viewing them requires making a prediction, Wall Street estimates are provided for free","" | ||||
| "Estimates for Zoetis (ZTS)","A link to Estimize's forecasts for *Zoetis* (sticker symbol ZTS). Viewing them requires making a prediction, Wall Street estimates are provided for free","" | ||||
| "In Google LLC v. Oracle America Inc., the SCOTUS will affirm the lower court's decision","21.43% (21 out of 98) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In United States v. Collins, the SCOTUS will affirm the lower court's decision","74.47% (70 out of 94) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Borden v. United States, the SCOTUS will affirm the lower court's decision","52.94% (27 out of 51) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Jones v. Mississippi, the SCOTUS will affirm the lower court's decision","33.87% (21 out of 62) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Fulton v. City of Philadelphia, Pennsylvania, the SCOTUS will affirm the lower court's decision","10.71% (9 out of 84) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Niz-Chavez v. Barr, the SCOTUS will affirm the lower court's decision","28.57% (14 out of 49) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In California v. Texas (Standing), the SCOTUS will affirm the lower court's decision","73.33% (44 out of 60) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Texas v. California (Severability), the SCOTUS will affirm the lower court's decision","30.16% (19 out of 63) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 7-2. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Van Buren v. United States, the SCOTUS will affirm the lower court's decision","14.29% (8 out of 56) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In CIC Services, LLC v. Internal Revenue Service, the SCOTUS will affirm the lower court's decision","65.85% (27 out of 41) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Nestle USA, Inc. v. Doe I, the SCOTUS will affirm the lower court's decision","19.51% (8 out of 41) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 8-1. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Cargill, Inc. v. Doe I, the SCOTUS will affirm the lower court's decision","15.79% (6 out of 38) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 7-2. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Edwards v. Vannoy, the SCOTUS will affirm the lower court's decision","36.73% (18 out of 49) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 8-1. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Facebook Inc. v. Duguid, the SCOTUS will affirm the lower court's decision","58.54% (24 out of 41) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Henry Schein Inc. v. Archer, the SCOTUS will affirm the lower court's decision","6.25% (2 out of 32) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Mnuchin v. Collins, the SCOTUS will affirm the lower court's decision","62.50% (20 out of 32) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Collins v. Mnuchin, the SCOTUS will affirm the lower court's decision","84.38% (27 out of 32) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Pham v. Guzman Chavez, the SCOTUS will affirm the lower court's decision","34.38% (11 out of 32) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In AMG Capital Management, LLC v. FTC, the SCOTUS will affirm the lower court's decision","25.81% (8 out of 31) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Federal Communications Commission v. Prometheus Radio Project, the SCOTUS will affirm the lower court's decision","18.92% (7 out of 37) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 8-1. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In BP P.L.C. v. Mayor and City Council of Baltimore, the SCOTUS will affirm the lower court's decision","22.22% (8 out of 36) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Cedar Point Nursery v. Hassid, the SCOTUS will affirm the lower court's decision","50.00% (2 out of 4) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In United States v. Cooley, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 8) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Caniglia v. Strom, the SCOTUS will affirm the lower court's decision","16.67% (1 out of 6) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Goldman Sachs Group Inc. v. Arkansas Teacher Retirement System, the SCOTUS will affirm the lower court's decision","100.00% (3 out of 3) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In TransUnion LLC v. Ramirez, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In American Athletic Conference v. Alston, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In National Collegiate Athletic Association v. Alston, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 3) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Alaska Native Village Corporation Association v. Confederated Tribes of the Chehalis Reservation, the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Sanchez v. Mayorkas, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Yellen v. Confederated Tribes of the Chehalis Reservation, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In United States v. Gary, the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Greer v. United States, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Minerva Surgical Inc. v. Hologic Inc., the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In City of San Antonio, Texas v. Hotels.com, L.P., the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Americans for Prosperity Foundation v. Becerra, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Guam v. United States, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Thomas More Law Center v. Becerra, the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In United States v. Palomar-Santiago, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In HollyFrontier Cheyenne Refining, LLC v. Renewable Fuels Association, the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Mahanoy Area School District v. B.L., the SCOTUS will affirm the lower court's decision","100.00% (2 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In PennEast Pipeline Co. v. New Jersey, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 2) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Davis v. Saul, the SCOTUS will affirm the lower court's decision","16.67% (2 out of 12) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Lange v. California, the SCOTUS will affirm the lower court's decision","36.11% (13 out of 36) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 5-4. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Arthrex Inc. v. Smith & Nephew Inc., the SCOTUS will affirm the lower court's decision","15.38% (2 out of 13) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Smith & Nephew Inc. v. Arthrex Inc., the SCOTUS will affirm the lower court's decision","80.00% (12 out of 15) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In National Association of Broadcasters v. Prometheus Radio Project, the SCOTUS will affirm the lower court's decision","18.18% (2 out of 11) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 8-1. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Carr v. Saul, the SCOTUS will affirm the lower court's decision","31.25% (5 out of 16) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In United States v. Arthrex Inc., the SCOTUS will affirm the lower court's decision","81.25% (13 out of 16) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Barr v. Dai, the SCOTUS will affirm the lower court's decision","37.50% (6 out of 16) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Barr v. Alcaraz-Enriquez, the SCOTUS will affirm the lower court's decision","53.33% (8 out of 15) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Wolf v. Innovation Law Lab, the SCOTUS will affirm the lower court's decision","100.00% (4 out of 4) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 7-2. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Brnovich v. Democratic National Committee, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 19) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Arizona Republican Party v. Democratic National Committee, the SCOTUS will affirm the lower court's decision","4.17% (1 out of 24) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 6-3. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Department of Justice v. House Committee on the Judiciary, the SCOTUS will affirm the lower court's decision","0.00% (0 out of 8) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Reverse 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "In Trump v. Sierra Club, the SCOTUS will affirm the lower court's decision","66.67% (10 out of 15) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 9-0. Historically, FantasySCOTUS has chosen the correct side 64.71% of the time.","Yes, No" | ||||
| "Hours of 80,000 Hours podcast content released","","" | ||||
| "% global rate of ""$1.90 a day"" poverty in 2030","","" | ||||
| "A bioengineering project kills at least five thousand people by 2023-02-15","","Yes, No" | ||||
|  |  | |||
| Can't render this file because it is too large. | 
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										108
									
								
								src/fantasyscotus-fetch.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								src/fantasyscotus-fetch.js
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,108 @@ | |||
| /* Imports */ | ||||
| import fs from 'fs' | ||||
| import axios from "axios" | ||||
| import { calculateStars } from "./stars.js" | ||||
| 
 | ||||
| /* Definitions */ | ||||
| let unixtime = new Date() .getTime() | ||||
| let endpoint = `https://fantasyscotus.net/case/list/?filterscount=0&groupscount=0&pagenum=0&pagesize=20&recordstartindex=0&recordendindex=12&_=${unixtime}` | ||||
| 
 | ||||
| async function fetchData() { | ||||
|   let response = await axios({ | ||||
|       "url": endpoint, | ||||
|       "credentials": "omit", | ||||
|       "headers": { | ||||
|           "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0", | ||||
|           "Accept": "application/json, text/javascript, */*; q=0.01", | ||||
|           "Accept-Language": "en-US,en;q=0.5", | ||||
|           "Content-Type": "application/x-www-form-urlencoded", | ||||
|           "X-Requested-With": "XMLHttpRequest" | ||||
|       }, | ||||
|       "referrer": "https://fantasyscotus.net/case/list/", | ||||
|       "method": "GET", | ||||
|       "mode": "cors" | ||||
|     }) | ||||
|     .then(res => res.data) | ||||
|   //console.log(response)
 | ||||
|   return response | ||||
| } | ||||
| 
 | ||||
| async function getPredictionsData(caseUrl) { | ||||
|   let newCaseUrl = `https://fantasyscotus.net/user-predictions${caseUrl}?filterscount=0&groupscount=0&sortdatafield=username&sortorder=asc&pagenum=0&pagesize=20&recordstartindex=0&recordendindex=20&_=${unixtime}` | ||||
|   //console.log(newCaseUrl)
 | ||||
|   let predictions = await axios({ | ||||
|       "url": newCaseUrl, | ||||
|       "credentials": "include", | ||||
|       "headers": { | ||||
|           "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0", | ||||
|           "Accept": "application/json, text/javascript, */*; q=0.01", | ||||
|           "Accept-Language": "en-US,en;q=0.5", | ||||
|           "Content-Type": "application/x-www-form-urlencoded", | ||||
|           "X-Requested-With": "XMLHttpRequest" | ||||
|       }, | ||||
|       "referrer": newCaseUrl, | ||||
|       "method": "GET", | ||||
|       "mode": "cors" | ||||
|   }) | ||||
|   .then(res => res.data) | ||||
|    | ||||
|   let predictionsAffirm = predictions.filter(prediction => prediction.percent_affirm > 50) | ||||
|   //console.log(predictions)
 | ||||
|   //console.log(predictionsAffirm.length/predictions.length)
 | ||||
|    | ||||
|   return ({ | ||||
|     numAffirm: predictionsAffirm.length, | ||||
|     proportionAffirm: predictionsAffirm.length/predictions.length, | ||||
|     numForecasts: predictions.length | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| async function processData(data) { | ||||
|   let events = data.object_list | ||||
|   let historicalPercentageCorrect = data.stats.pcnt_correct | ||||
|   let historicalProbabilityCorrect = Number(historicalPercentageCorrect.replace("%",""))/100 | ||||
|   let results = []  | ||||
|   for(let event of events){ | ||||
|     if(event.accuracy == ''){ // if the thing hasn't already resolved
 | ||||
|       let predictionData = await getPredictionsData(event.docket_url) | ||||
|       let pAffirm = predictionData.proportionAffirm | ||||
|       //let trackRecord = event.prediction.includes("Affirm") ? historicalProbabilityCorrect : 1-historicalProbabilityCorrect
 | ||||
|       let eventObject = ({ | ||||
|         "title": `In ${event.short_name}, the SCOTUS will affirm the lower court's decision`, | ||||
|         "url": `https://fantasyscotus.net/user-predictions${event.docket_url}`, | ||||
|         "platform": "FantasySCOTUS", | ||||
|         "description": `${(pAffirm*100).toFixed(2)}% (${predictionData.numAffirm} out of ${predictionData.numForecasts}) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of ${event.prediction}. Historically, FantasySCOTUS has chosen the correct side ${historicalPercentageCorrect} of the time.`, | ||||
|         "options": [ | ||||
|                 { | ||||
|                   "name": "Yes", | ||||
|                   "probability":  pAffirm, | ||||
|                   "type": "PROBABILITY" | ||||
|                 }, | ||||
|                 { | ||||
|                   "name": "No", | ||||
|                   "probability": 1-pAffirm, | ||||
|                   "type": "PROBABILITY" | ||||
|                 } | ||||
|               ], | ||||
|         "numforecasts": predictionData.numForecasts, | ||||
|         "stars": calculateStars("FantasySCOTUS", ({})) | ||||
|       }) | ||||
|       console.log(eventObject) | ||||
|       results.push(eventObject) | ||||
|     } | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   return results | ||||
| }  | ||||
| 
 | ||||
| /* Body */ | ||||
| export async function fantasyscotus() { | ||||
|   let rawData = await fetchData() | ||||
|   let results = await processData(rawData) | ||||
|   //console.log(results)
 | ||||
|   let string = JSON.stringify(results, null, 2) | ||||
|   fs.writeFileSync('./data/fantasyscotus-questions.json', string); | ||||
|   console.log("Done") | ||||
| } | ||||
| //fantasyscotus()
 | ||||
							
								
								
									
										106
									
								
								src/index.js
									
									
									
									
									
								
							
							
						
						
									
										106
									
								
								src/index.js
									
									
									
									
									
								
							|  | @ -6,6 +6,7 @@ import readline from "readline" | |||
| import {csetforetell} from "./csetforetell-fetch.js" | ||||
| import {elicit} from "./elicit-fetch.js" | ||||
| import {estimize} from "./estimize-fetch.js" | ||||
| import {fantasyscotus} from "./fantasyscotus-fetch.js" | ||||
| import {foretold} from "./foretold-fetch.js" | ||||
| import {goodjudgment} from "./goodjudgment-fetch.js" | ||||
| import {goodjudgmentopen} from "./goodjudmentopen-fetch.js" | ||||
|  | @ -21,9 +22,8 @@ import {williamhill} from "./williamhill-fetch.js" | |||
| /* Definitions */ | ||||
| let opts = {} | ||||
| let json2csvParser = new Parser({ transforms:  [transforms.flatten()]}); | ||||
| //let parse = csv => json2csvParser.parse(csv);
 | ||||
| // let sets = ["template", "elicit", "foretold", "metaculus", "predictit", "polymarket", "csetforetell", "givewellopenphil", "goodjudgment","goodjudmentopen", "omen", "hypermind", "smarkets", "williamhill", "ladbrokes", "xrisk"]
 | ||||
| let sets = ["csetforetell", "elicit", "estimize", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "ladbrokes", "metaculus", "polymarket", "predictit", "omen", "smarkets", "williamhill", "xrisk"] | ||||
| let sets = ["csetforetell", "elicit", "estimize", "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "ladbrokes", "metaculus", "polymarket", "predictit", "omen", "smarkets", "williamhill", "xrisk"] | ||||
| 
 | ||||
| let suffix = "-questions" | ||||
| let locationData = "./data/" | ||||
| let sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | ||||
|  | @ -81,93 +81,27 @@ async function whattodo(message,callback){ | |||
|   }); | ||||
| } | ||||
| 
 | ||||
| let functions = [csetforetell, elicit, estimize, fantasyscotus, /* foretold, */ goodjudgment, goodjudgmentopen, hypermind, ladbrokes, metaculus, polymarket, predictit, omen, smarkets, williamhill, coverttocsvandmerge] | ||||
| let functionNames =  functions.map(fun => fun.name)// ["csetforetell", "elicit", "estimize", "fantasyscotus", /* "foretold", */ "goodjudgment", "goodjudgmentopen", "hypermind", "ladbrokes", "metaculus", "polymarket", "predictit", "omen", "smarkets", "williamhill", "coverttocsvandmerge"]
 | ||||
| let whattodoMessage = "What do you want to do?\n" +  | ||||
|   functionNames.map((functionName,i) => i != (functionNames.length -1) ? `[${i}]: Download predictions from ${functionName}` : `[${i}]: Merge jsons them into one big json
 | ||||
| [${i+1}]: All of the above | ||||
| Choose one option, wisely: #`)
 | ||||
|   .join("\n") | ||||
|    | ||||
| let executeoption = async (option) => { | ||||
|   option = Number(option) | ||||
|   switch (option) { | ||||
|     case 1: | ||||
|       csetforetell() | ||||
|       break; | ||||
|     case 2: | ||||
|       elicit() | ||||
|       break; | ||||
|     case 3: | ||||
|       estimize() | ||||
|       break; | ||||
|     case 4: | ||||
|       foretold() | ||||
|       break; | ||||
|     case 5: | ||||
|       goodjudgment() | ||||
|       break; | ||||
|     case 6: | ||||
|       goodjudgmentopen() | ||||
|       break; | ||||
|     case 7: | ||||
|       hypermind() | ||||
|       break; | ||||
|     case 8: | ||||
|       ladbrokes() | ||||
|       break; | ||||
|     case 9: | ||||
|       metaculus() | ||||
|       break; | ||||
|     case 10: | ||||
|       omen() | ||||
|       break; | ||||
|     case 11: | ||||
|       polymarket() | ||||
|       break; | ||||
|     case 12:     | ||||
|       predictit() | ||||
|       break; | ||||
|     case 13: | ||||
|       smarkets() | ||||
|       break; | ||||
|     case 14: | ||||
|       williamhill() | ||||
|     break; | ||||
|     case 15: | ||||
|       coverttocsvandmerge() | ||||
|       break; | ||||
|     case 16: | ||||
|       await csetforetell() | ||||
|       await elicit() | ||||
|       //await foretold()
 | ||||
|       await goodjudgment() | ||||
|       await goodjudgmentopen() | ||||
|       await hypermind() | ||||
|       await ladbrokes() | ||||
|       await metaculus() | ||||
|       await omen() | ||||
|       await polymarket() | ||||
|       await predictit() | ||||
|       await smarkets() | ||||
|       await coverttocsvandmerge() | ||||
|       break; | ||||
|     default: | ||||
|       console.log("Sorry, invalid case") | ||||
|       break; | ||||
|   console.log(functionNames[option]) | ||||
|   if(option < 0){ | ||||
|     console.log("Error, ${option} < 0") | ||||
|   }else if(option < functions.length){ | ||||
|     functions[option]() | ||||
|   } else if(option == functions.length){ | ||||
|     for(let fun of functions){ | ||||
|       fun() | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /* BODY */ | ||||
| let whattodoMessage = `What do you want to do?
 | ||||
| [1]: Download predictions from csetforetell | ||||
| [2]: Download predictions from elicit | ||||
| [3]: Download predictions from estimize | ||||
| [4]: Download predictions from foretold | ||||
| [5]: Download predictions from goodjudgment | ||||
| [6]: Download predictions from goodjudgmentopen | ||||
| [7]: Download predictions from hypermind | ||||
| [8]: Download predictions from ladbrokes | ||||
| [9]: Download predictions from metaculus | ||||
| [10]: Download predictions from omen | ||||
| [11]: Download predictions from polymarket | ||||
| [12]: Download predictions from predictit | ||||
| [13]: Download predictions from smarkets | ||||
| [14]: Download predictions from William Hill | ||||
| [15]: Merge jsons them into one big json (requires previous steps) | ||||
| [16]: All of the above | ||||
| Choose one option, wisely: #` | ||||
| 
 | ||||
| whattodo(whattodoMessage, executeoption) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user