Skip to content

Commit

Permalink
Uses live data for the app
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasdotcom committed Jun 15, 2022
1 parent 1c68941 commit 8b51a5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bundesliga",
"version": "0.1.3",
"version": "0.1.5",
"private": true,
"scripts": {
"dev": "npm install; node scripts/entrypoint.mjs & next dev",
Expand Down
6 changes: 3 additions & 3 deletions scripts/update.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export async function updateData() {
})
const nowTime = parseInt(Date.now()/1000)
connection.query("INSERT INTO data VALUES('playerUpdate', ?) ON DUPLICATE KEY UPDATE value2=?", [nowTime, nowTime])
/*const data = fetch("https://fantasy.bundesliga.com/api/player_transfers/init", {
const data = fetch("https://fantasy.bundesliga.com/api/player_transfers/init", {
method: 'POST',
headers:{
'Content-Type':'application/json',
'Cookie':`access_token=${process.env.BUNDESLIGA_API}`
},
body: JSON.stringify({"payload":{"offerings_query":{"offset":0,"limit":1000,"sort":{"order_by":"popularity","order_direction":"desc"}}}})
}).then(async (val) => {return await val.json()})*/
const data = fetch("http://localhost:3000/data.json").then(async (val) => {return await val.json()})
}).then(async (val) => {return await val.json()})
//const data = fetch("http://localhost:3000/data.json").then(async (val) => {return await val.json()})
// Puts in the data if the transfermarket is open
const oldTransfer = await new Promise((res) => {
connection.query("SELECT * FROM data WHERE value1='transferOpen'", function(error, result, field) {
Expand Down

0 comments on commit 8b51a5b

Please sign in to comment.