Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terremotos por consola con Nodejs #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codemcu
Copy link
Collaborator

@codemcu codemcu commented Mar 5, 2019

Terremotos por consola con Nodejs

@codemcu codemcu requested a review from UlisesGascon March 5, 2019 18:42
@UlisesGascon UlisesGascon mentioned this pull request May 31, 2019
46 tasks
Copy link
Contributor

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Objetivo logrado, pero falta validar inputs y optimizar un poco las salidas por consola. 😉

@@ -0,0 +1,39 @@
const https = require('https');

const [,,grade, frecuency] = process.argv;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bueno... ,, no es un mal hack, pero según como sea el equipo ... igual alguien podría molestarse. Por lo general, la norma no escrita dice que la idea es saltar una única posición del array

const https = require('https');

const [,,grade, frecuency] = process.argv;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ No validas que te hayan pasados parametros validos... grade podría ser cualquier cosa y generarte errores en la URL...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo mismo se aplica para frecuency

console.log(new Date(parsed.metadata.generated).toLocaleString('es-ES'));
console.log('==============================');
parsed.features.forEach(feature => {
console.log(feature.properties.title);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sería más interesante montar un bloque de texto con toda la información y hacer console.log una vez por vuelta o al final del todo usando un map con un join

const text = parsed.features.map(lorem_ipsum).join(''); 
console.log(text)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants