{
  "name": "Keencrest: GDELT brand news alert to Slack (Apify watch mode)",
  "flow": [
    {
      "id": 1,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {
        "handleErrors": true,
        "useNewZLibDeCompress": true
      },
      "mapper": {
        "url": "https://api.apify.com/v2/acts/datagleaner~gdelt-news-monitor/run-sync-get-dataset-items?maxTotalChargeUsd=1",
        "serializeUrl": false,
        "method": "post",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer YOUR_APIFY_TOKEN"
          }
        ],
        "qs": [],
        "bodyType": "raw",
        "contentType": "application/json",
        "parseResponse": true,
        "timeout": "300",
        "shareCookies": false,
        "followRedirect": true,
        "rejectUnauthorized": true,
        "data": "{\"keywords\": [\"YOUR BRAND\", \"YOUR PRODUCT\"], \"languages\": [\"en\"], \"hoursBack\": 6, \"watchMode\": true, \"watchName\": \"brand-alert-make\", \"maxItems\": 100}"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "GDELT News Monitor (Apify, watch mode)"
        }
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{1.data}}"
      },
      "metadata": {
        "designer": {
          "x": 250,
          "y": 0,
          "name": "Each new article"
        }
      }
    },
    {
      "id": 3,
      "module": "util:TextAggregator",
      "version": 1,
      "parameters": {
        "feeder": 2,
        "rowSeparator": "\n"
      },
      "mapper": {
        "value": "- <{{2.url}}|{{substring(replace(replace(2.title; \"|\"; \" \"); \">\"; \" \"); 0; 120)}}> - {{2.sourceDomain}}"
      },
      "metadata": {
        "designer": {
          "x": 500,
          "y": 0,
          "name": "One line per article"
        }
      }
    },
    {
      "id": 4,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {
        "handleErrors": true,
        "useNewZLibDeCompress": true
      },
      "mapper": {
        "url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
        "serializeUrl": false,
        "method": "post",
        "headers": [],
        "qs": [],
        "bodyType": "raw",
        "contentType": "application/json",
        "parseResponse": false,
        "timeout": "",
        "shareCookies": false,
        "followRedirect": true,
        "rejectUnauthorized": true,
        "data": "{\"text\": {{toJSON(\"New news articles mentioning your brand:\" + newline + 3.text + newline + \"Data: GDELT Project (gdeltproject.org)\")}}}"
      },
      "metadata": {
        "designer": {
          "x": 750,
          "y": 0,
          "name": "Post to Slack (incoming webhook)"
        }
      }
    }
  ],
  "metadata": {
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu1.make.com"
  }
}