This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function fanduel() { | |
| // var response = await request.get(`https://sportsbook.draftkings.com/leagues/basketball/nba`); | |
| // var $ = cheerio.load(response); | |
| // var buttonLength = 0; | |
| // var c; | |
| // $("#fittPageContainer > div:nth-child(2) > div > div:nth-child(6) > div > div.PageLayout__Main > section.Card.Card--PlayByPlay > div > nav > ul > li").each((index, element)=>{ | |
| // c = $(element).find('button'); | |
| // }); | |
| //executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", userDataDir: '/Users/tamzidullah/Library/Application Support/Google/Chrome/Tamzid' | |
| const browser = await puppeteer.launch({ headless: false}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pivots(n, s) { | |
| var pivots = []; | |
| for(var i = 0; i < n.length - 5; i++) { | |
| //console.log(n[i]); | |
| if(n[i].diff < 0 && n[i+1].diff > 0 && n[i+2].diff > 0 && n[i+3].diff > 0 && n[i+4].diff > 0 && n[i+1].diff === 2 && n[i+2].diff === 1 && n[i+3].diff === 2 && n[i+4].diff === 3) { | |
| pivots.push({ | |
| team: `${s}`, | |
| quarter: n[i+4].quarter, | |
| time: n[i+4].time, | |
| seconds: n[i+4].seconds, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function determineWinner(a, h) { | |
| var softmax; | |
| var swinner; | |
| for(var x = 0;x < a.length - 2;x++) { | |
| softmax = Math.E ** a[x+2].difference / ((Math.E ** a[x+2].difference) + (Math.E ** a[x+1].difference) + (Math.E ** a[x].difference)); | |
| if(a[x+2].difference > a[x+1].difference && a[x+1].difference > a[x].difference && softmax < 0.85) { | |
| swinner = 'away'; | |
| } else { | |
| swinner = ''; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //basketball object | |
| var testscore = [[0,2],[0,4],[0,6],[2,6]]; | |
| console.log(calculateDiff(testscore, 0)); | |
| function calculateDiff(s,t) { | |
| scoreDiff = []; | |
| for(var x = 0;x < s.length - 1;x++){ | |
| currentAwayScore = s[x][0]; | |
| transitionScoreAway = s[x+1][0]; | |
| currentHomeScore = s[x][1]; | |
| transitionScoreHome = s[x+1][1]; |