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

Fix latercera portada #625

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kyuumeitai
Copy link

Descripción

  • Cambia el endpoint de la tercera y de la cuarta
  • Agrega el caso de http response 302 ya que los endpoints redirigen hacia la imagen del día

Ejemplo de comportamiento

huemul portada la tercera
https://kiosco.latercera.com/latest-issue-cover-image?collection=lt_diario_la_tercera_6_30&nocache=20200424
huemul portada la cuarta
huemul> https://kiosco.lacuarta.com/latest-issue-cover-image?collection=lc_diario_la_cuarta&nocache=20200424

}
} else {
sendPortadaDate(res, fecha)
res.http(testUrl).timeout(2000).get()((err, response, body) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No soy muy fan del estilo, pero la indentación debería ser igual al archivo original

Copy link
Author

Choose a reason for hiding this comment

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

Entonces prettier no está configurado en el proyecto, no? @gmq

scripts/portadas.js Show resolved Hide resolved
@kyuumeitai kyuumeitai requested a review from a team as a code owner April 24, 2020 17:16
@@ -122,6 +130,6 @@
"husky": "0.14.3",
"lint-staged": "9.4.2",
"nock": "9.2.6",
"prettier": "1.12.1"
"prettier": "2.0.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Un version bump debería estar en un PR aparte

Copy link
Contributor

Choose a reason for hiding this comment

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

De hecho este cambio completo debería ser un PR aparte, no es de latercera este cambio?

case 302:
ready = false
sendPortadaDate(res, fecha)
resolve(testUrl)
Copy link
Collaborator

@PotterSys PotterSys May 19, 2020

Choose a reason for hiding this comment

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

En este caso, debería devolver el header Location que devuelve el servidor. Eso sí, hay que chequear que Location != testUrl para evitar caer en un bucle infinito (si son iguales, debería indicar que no hay portada)

Copy link
Collaborator

@PotterSys PotterSys left a comment

Choose a reason for hiding this comment

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

  • Hay que separar los pull requests (uno por las portadas, otro por el prettifier)
  • Ya que hay un procesado de código HTTP 302, debe devolver la dirección a la que redirecciona y no la original

Comment on lines +5344 to +5347
prettier@2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
Copy link
Contributor

Choose a reason for hiding this comment

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

Esta magia debería estar en un PR aparte

@gmq gmq force-pushed the master branch 3 times, most recently from fde96ef to d12d3d6 Compare October 18, 2021 23:06
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.

None yet

4 participants