anon-dot-com / actions

A library of actions for automating the internet.
10 stars 3 forks source link

Sample Code Missing Variables #3

Closed grant closed 2 days ago

grant commented 3 months ago

Looking at the sample, it looks like the sample requires some defined variables:

Here's the formatted code:

import { NetworkHelper, runCreateLinkedinPost } from "@anon/actions";
import {
  Client,
  executeRuntimeScript,
  setupAnonBrowserWithContext,
} from "@anon/sdk-typescript";
import { Page } from "playwright";

console.log(
  `Setting up browser script for ${account.app} session for app user id ${APP_USER_ID}`,
);
const { browserContext } = await setupAnonBrowserWithContext(client, account, {
  type: "local",
  input: { headless: false },
});

const message = `This post was constructed with the Anon SDK! Integrate your AI apps to the real world using Anon. Come
check out https://www.anon.com/`;
const result = await executeRuntimeScript({
  client,
  account,
  target: { browserContext: browserContext },
  initialUrl: "https://www.linkedin.com",
  run: runCreateLinkedinPost(new NetworkHelper(1000), message),
});