{
  "nodes": [
    {
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "position": [
        1050,
        500
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"HTML Extract Data\"].data[\"title\"]}}",
              "value2": "Show HN:",
              "operation": "contains"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1450,
        400
      ],
      "parameters": {
        "text": "={{$node[\"Function\"].data[\"emailText\"]}}",
        "options": {},
        "subject": "Trending Show HN"
      },
      "typeVersion": 1
    },
    {
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        250,
        500
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 13
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "position": [
        1250,
        400
      ],
      "parameters": {
        "functionCode": "let emailText = 'Currently trending \"Show HN\":\\n\\n';\n\nfor (let item of items) {\n  emailText += `${item.json.rank} ${item.json.title}\\n${item.json.url}\\n\\n`;\n}\n\nreturn [{json: {emailText}}]\n"
      },
      "typeVersion": 1
    },
    {
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        450,
        500
      ],
      "parameters": {
        "url": "https://news.ycombinator.com/",
        "options": {},
        "responseFormat": "string"
      },
      "typeVersion": 1
    },
    {
      "name": "HTML Extract Items",
      "type": "n8n-nodes-base.htmlExtract",
      "position": [
        650,
        500
      ],
      "parameters": {
        "options": {},
        "extractionValues": {
          "values": [
            {
              "key": "REPLACE_WITH_KEY",
              "cssSelector": "tr.athing",
              "returnArray": true,
              "returnValue": "html"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "HTML Extract Data",
      "type": "n8n-nodes-base.htmlExtract",
      "position": [
        850,
        500
      ],
      "parameters": {
        "options": {},
        "dataPropertyName": "item",
        "extractionValues": {
          "values": [
            {
              "key": "REPLACE_WITH_KEY",
              "cssSelector": "a"
            },
            {
              "key": "REPLACE_WITH_KEY",
              "attribute": "href",
              "cssSelector": "a.storylink",
              "returnValue": "attribute"
            },
            {
              "key": "REPLACE_WITH_KEY",
              "cssSelector": ".rank"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5c764f09-68a2-5f88-9144-f3f5583a3836",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# email send and cron and http request\n\n## Purpose and structure\nThis folder contains the **email send and cron and http request** workflow. Its executable nodes use `cron`, `emailSend`, `function`, `htmlExtract`, `httpRequest`, `if`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nCron\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Http/0494_HTTP_Htmlextract_Send_Webhook.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "connections": {
    "IF": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "HTML Extract Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract Data": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extract Items": {
      "main": [
        [
          {
            "node": "HTML Extract Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
