Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(scrape): support Google Slides (#1693)

Meet Soni2082243cb50c
diff --git a/apps/api/src/__tests__/snips/scrape.test.ts b/apps/api/src/__tests__/snips/scrape.test.ts
index 3a2f0e796..27ea6b2a7 100644
--- a/apps/api/src/__tests__/snips/scrape.test.ts
+++ b/apps/api/src/__tests__/snips/scrape.test.ts
@@ -777,6 +777,15 @@ describe("Scrape tests", () => {
expect(response.markdown).toContain("This is a test to confirm Google Docs scraping abilities.");
}, 310000);
+
+ it.concurrent("scrapes Google Slides links as PDFs", async () => {
+ const response = await scrape({
+ url: "https://docs.google.com/presentation/d/1pDKL1UULpr6siq_eVWE1hjqt5MKCgSSuKS_MWahnHAQ/view",
+ timeout: 300000,
+ });
+
+ expect(response.markdown).toContain("This is a test to confirm Google Slides scraping abilities.");
+ }, 310000);
});
}
diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts
index a2a822d6f..65b697b42 100644
--- a/apps/api/src/scraper/scrapeURL/index.ts
+++ b/apps/api/src/scraper/scrapeURL/index.ts
@@ -163,6 +163,11 @@ async function buildMetaObject(
if (id) {
rewrittenUrl = `https://docs.google.com/document/d/${id}/export?format=pdf`;
}
+ } else if (url.startsWith("https://docs.google.com/presentation/d/") || url.startsWith("http://docs.google.com/presentation/d/")) {
+ const id = url.match(/\/presentation\/d\/([-\w]+)/)?.[1];
+ if (id) {
+ rewrittenUrl = `https://docs.google.com/presentation/d/${id}/export?format=pdf`;
+ }
}
return {