handler.ts 646 B

12345678910111213141516171819202122
  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: "section.top-mainy article.card",
  12. titleSelector: "div.headline",
  13. linkSelector: "div.headline a",
  14. linkPrefix: "https://www.latercera.cl",
  15. scraperMethod: ScraperMethods.PUPPETEER,
  16. cacheExpiration: 60 * 60 * 24 * 5, // 5 días
  17. hashtags: ["LaTercera", "LT", "Noticias"]
  18. }
  19. ).getHandler();