We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 477e169 commit 04fd340Copy full SHA for 04fd340
references/v3-catalog/src/trigger/lightpandaTask.ts
@@ -0,0 +1,25 @@
1
+import { logger, task } from "@trigger.dev/sdk/v3";
2
+import { execSync } from "node:child_process";
3
+
4
+export const lightpandaFetch = task({
5
+ id: "lightpanda-fetch",
6
+ machine: {
7
+ preset: "micro",
8
+ },
9
+ run: async (payload: { url: string }, { ctx }) => {
10
+ logger.log("Lets get a page's content with Lightpanda!", { payload, ctx });
11
12
+ if (!payload.url) {
13
+ logger.warn("Please define the payload url");
14
+ throw new Error("payload.url is undefined");
15
+ }
16
17
+ const e = execSync(
18
+ `${process.env.LIGHTPANDA_BROWSER_PATH} fetch --dump ${payload.url}`,
19
+ );
20
21
+ return {
22
+ message: e.toString(),
23
+ };
24
25
+});
0 commit comments