Update src/routes/api/takeSnap.js
parent
1d986b75b4
commit
0836ec3ec0
|
@ -4,7 +4,7 @@ const path = require("path");
|
|||
const axios = require("axios");
|
||||
|
||||
const gameIds = [
|
||||
'1', '2', '3'
|
||||
'1', '2', '3', '4', '5', '6', '7', '9', '10', '11', '12', '13', '14', '15'
|
||||
];
|
||||
|
||||
const SCREENSHOT_FOLDER = path.join(__dirname, "game-screen/drawing");
|
||||
|
@ -17,7 +17,7 @@ const DIRECTUS_API_URL = "https://game-du.teachertrainingkolkata.in/files";
|
|||
async function takeSnap(req, res) {
|
||||
for (const id of gameIds) {
|
||||
try {
|
||||
const url = `https://interaktogames.beanstalkedu.com/drag/dragdrop_phonics?id=${id}`;
|
||||
const url = `https://interaktogames.beanstalkedu.com/drag/match_phonics?id=${id}`;
|
||||
console.log(`📸 Taking screenshot for Game ID: ${id}`);
|
||||
const command = `url2jpg ${url}`;
|
||||
execSync(command, { stdio: "inherit", shell: true });
|
||||
|
@ -63,7 +63,7 @@ async function uploadToDirectus(filePath) {
|
|||
|
||||
|
||||
async function updateThumbnail(gameId, fileId) {
|
||||
const UPDATE_THUMBNAIL_URL = "https://game-du.teachertrainingkolkata.in/items/drag_drop_phonics/";
|
||||
const UPDATE_THUMBNAIL_URL = "https://game-du.teachertrainingkolkata.in/items/drag_phonics/";
|
||||
try {
|
||||
const response = await axios.patch(
|
||||
`${UPDATE_THUMBNAIL_URL}${gameId}`,
|
||||
|
|
Loading…
Reference in New Issue