$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "startUrls": [
< {
< "url": "https://apify.com"
< }
< ],
< "pseudoUrls": [
< {
< "purl": "https://apify.com[(/[\\w-]+)?]"
< }
< ],
< "linkSelector": "a",
< "pageFunction": "async function pageFunction(context) {\n // See README for context properties. If the syntax is unfamiliar see the link\n // https://javascript.info/destructuring-assignment#object-destructuring\n const { request, log, jQuery } = context;\n\n // To be able to use jQuery as $, one needs save it into a variable\n // and select the inject jQuery option. We've selected it for you.\n const $ = jQuery;\n const title = $('title').text();\n\n // This is yet another new feature of Javascript called template strings.\n // https://javascript.info/string#quotes\n log.info(`URL: ${request.url} TITLE: ${title}`);\n\n // To save data just return an object with the requested properties.\n return {\n url: request.url,\n title\n };\n}",
< "proxyConfiguration": {
< "useApifyProxy": false
< },
< "initialCookies": [],
< "waitUntil": [
< "networkidle2"
< ],
< "customData": {}
<}
<EOF
$curl "https://api.apify.com/v2/acts/mtrunkat~web-scraper-experimental-dbgr/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'