handler.ts 761 B

12345678910111213141516171819202122232425
  1. import { type Handler } from "aws-lambda";
  2. import config from "../../config";
  3. import Portal from "../portal";
  4. import ScraperMethods from "../../enums/scraper-methods";
  5. const name = "La Tercera";
  6. export const handler: Handler = new Portal(
  7. name,
  8. config.MASTODON_KEY_LATERCERA,
  9. {
  10. url: config.LATERCERA,
  11. articlesSelector: ".story-card",
  12. titleSelector: ".story-card__headline",
  13. linkSelector: ".story-card__headline a",
  14. contentSelector: ".story-card__description",
  15. imageSelector: ".story-card__image img",
  16. linkPrefix: "https://www.latercera.com",
  17. scraperMethod: ScraperMethods.PUPPETEER,
  18. cacheExpiration: 60 * 60 * 24 * 5, // 5 días
  19. maxArticles: 20,
  20. hashtags: ["LaTercera", "LT", "Noticias"]
  21. }
  22. ).getHandler();