From bc784121e3ec287fcad8f28ebfeac04b8641d199 Mon Sep 17 00:00:00 2001 From: Melro Serdoura Daniel Date: Fri, 17 Nov 2023 15:23:06 +0100 Subject: [PATCH] Initial commit --- css/style.css | 5 ----- index.html | 16 ++++++++++++++ js/test.js | 52 ++++++++++++++++++++++++++++++++++++++++++++ templates/index.html | 19 ---------------- token | 1 - token.txt | 3 +++ 6 files changed, 71 insertions(+), 25 deletions(-) delete mode 100644 css/style.css create mode 100644 index.html create mode 100644 js/test.js delete mode 100644 templates/index.html delete mode 100644 token create mode 100644 token.txt diff --git a/css/style.css b/css/style.css deleted file mode 100644 index aa39c4e..0000000 --- a/css/style.css +++ /dev/null @@ -1,5 +0,0 @@ -canvas { - width: 50%; - border: 2px solid black; - border-radius: 5px; -} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..224ee60 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + + Document + + + + + \ No newline at end of file diff --git a/js/test.js b/js/test.js new file mode 100644 index 0000000..48c596a --- /dev/null +++ b/js/test.js @@ -0,0 +1,52 @@ +'use strict' +//lister vaisseau +const token="Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjoiSEFNRE9VTEFITCIsInZlcnNpb24iOiJ2Mi4xLjEiLCJyZXNldF9kYXRlIjoiMjAyMy0xMS0wNCIsImlhdCI6MTcwMDIyNDI3MSwic3ViIjoiYWdlbnQtdG9rZW4ifQ.LNKY3vcOZIjiHUj-Z9z8kgNDqpQgB63u_6ceibfHQX-U1ox2bRjQqlSMnSjvUsXkx1G8qIDQUP9Sl-uuiHNzdtq1TmQD4x6c0nIEPNrP_OUbQSP98JZ2-xrp6h4TfXnK_o8OPqhpbRIH9iklnSrXswUZg6H2Cy78yS4sVaftiq0nBH5TLK4k5sEe5MVvhLiAuPAlNhYHUZdXP-T1y6PmmIim5d-0fwetkuC4Q2PLZp5Qg3b_2Bfy2GIUj4nI9m1e6ukaeuIF6VMYrsDUiBXD7jGrdFj2J2ZBrXKJQdQRfMKcUNpMqKdwM606S8VFDo6QHUxB5Rgi9GHFWGEKEMyBCQ" +const ListMyShips = { + async: true, + crossDomain: true, + url: 'https://api.spacetraders.io/v2/my/ships', + method: 'GET', + headers: { + Accept: 'application/json', + Authorization: token + }, + }; + $.ajax(ListMyShips).done(function (response) { + console.log(response); + }); + + + +const listWaypoints = { + async: true, + crossDomain: true, + url: 'https://api.spacetraders.io/v2/systems/X1-GY76/waypoints', + method: 'GET', + headers: { + Accept: 'application/json', + Authorization: token + } +}; + +$.ajax(listWaypoints).done(function (response) { + console.log(response); +}); + + + const travelShip = { + async: true, + crossDomain: true, + url: 'https://api.spacetraders.io/v2/my/ships/shipSymbol/navigate', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + Authorization: token + }, + processData: false, + data: '{\n "waypointSymbol":'+ waypoint+'\n}' + }; + + $.ajax(travelShip).done(function (response) { + console.log(response); + }); \ No newline at end of file diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index f372487..0000000 --- a/templates/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - Space traders - - -
- -
- -
- - \ No newline at end of file diff --git a/token b/token deleted file mode 100644 index 9b9b8d9..0000000 --- a/token +++ /dev/null @@ -1 +0,0 @@ -eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjoiQU5OTk5VTEFYMTIyNSIsInZlcnNpb24iOiJ2Mi4xLjEiLCJyZXNldF9kYXRlIjoiMjAyMy0xMS0wNCIsImlhdCI6MTcwMDIyNDU5MSwic3ViIjoiYWdlbnQtdG9rZW4ifQ.r05mWtD5FjC4s6Td-ycmHdzL7C2s75lz3q7OBmWeCqUUZ1ejPsRGQRWJDPmIh1kAqO4D9FFs3GCTPZUn1KsnQ-xmDvsIi_mqC1gJV-Q0irI7gwfsGXbfLaVCXo-Q98C_QWRh-O_xkrbhJkCcvnwdEhZm7FnZ3PL4XXKrG0XNa98JrnmG0qlz0cv8V9Q0sSIwXZbvA9BrhuV8PK7_YzPc6LZuNqgPeKiX_B-tSIHHl6Sr1EzuydnczmuS-xKQnbhmcqnpaCXzQmJr7tA8KLgu70KqpPCvA8AI6PLmBlvPWtZ20RdzezqlBh6S9SrBzQ9R0zr_9RyJxq28ws2jnHpVPw \ No newline at end of file diff --git a/token.txt b/token.txt new file mode 100644 index 0000000..c622557 --- /dev/null +++ b/token.txt @@ -0,0 +1,3 @@ +lister les vaisseaux de depart +comment on peut les deplacer +token : eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjoiSEFNRE9VTEFITCIsInZlcnNpb24iOiJ2Mi4xLjEiLCJyZXNldF9kYXRlIjoiMjAyMy0xMS0wNCIsImlhdCI6MTcwMDIyNDI3MSwic3ViIjoiYWdlbnQtdG9rZW4ifQ.LNKY3vcOZIjiHUj-Z9z8kgNDqpQgB63u_6ceibfHQX-U1ox2bRjQqlSMnSjvUsXkx1G8qIDQUP9Sl-uuiHNzdtq1TmQD4x6c0nIEPNrP_OUbQSP98JZ2-xrp6h4TfXnK_o8OPqhpbRIH9iklnSrXswUZg6H2Cy78yS4sVaftiq0nBH5TLK4k5sEe5MVvhLiAuPAlNhYHUZdXP-T1y6PmmIim5d-0fwetkuC4Q2PLZp5Qg3b_2Bfy2GIUj4nI9m1e6ukaeuIF6VMYrsDUiBXD7jGrdFj2J2ZBrXKJQdQRfMKcUNpMqKdwM606S8VFDo6QHUxB5Rgi9GHFWGEKEMyBCQ