handler.ts 660 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 = `Tarreo`;
  6. export const handler: Handler = new Portal(
  7. name,
  8. config.MASTODON_KEY_TARREO,
  9. {
  10. url: config.TARREO,
  11. articlesSelector: "section.lists_list_main ul.news li article",
  12. titleSelector: "h4.elementHeader a",
  13. linkSelector: "h4.elementHeader a",
  14. scraperMethod: ScraperMethods.AXIOS,
  15. hashtags: ["Tarreo", "VideoJuegos", "Noticias"],
  16. linkPrefix: "https://www.tarreo.com",
  17. cacheExpiration: 60 * 60 * 24 * 5, // 5 días
  18. }
  19. ).getHandler();