{
  "id": "HKTeS8KymXB9q4oR",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Blog Post Translator",
  "tags": [],
  "nodes": [
    {
      "id": "e490b9c8-89f1-4dd7-8274-1d33e9d89ba8",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -40,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "01266489-c432-402c-afb7-7f945aaf8469",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "https://dorik.com/blog/what-makes-a-good-website",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "d5b6cbea-9ac9-4378-96a5-ed61456183f8",
      "name": "Create a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        800,
        0
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appP62U5MtSww1eeP",
          "cachedResultUrl": "https://airtable.com/appP62U5MtSww1eeP",
          "cachedResultName": "N8n experiment"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblHVSfUR71dToSif",
          "cachedResultUrl": "https://airtable.com/appP62U5MtSww1eeP/tblHVSfUR71dToSif",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "HTML": "={{ $json.blogContent }}",
            "TRANSLATED": "="
          },
          "schema": [
            {
              "id": "HTML",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "HTML",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TRANSLATED",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TRANSLATED",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7d4f54ee-0401-4bdb-baea-046b2d05ae9d",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        0
      ],
      "parameters": {
        "jsCode": "const cheerio = require('cheerio');\n\nconst raw = items[0].json.body || items[0].json.data || items[0].json;\nconst html = typeof raw === 'string' ? raw : JSON.stringify(raw);\n\nconst $ = cheerio.load(html);\n\n// Extract just the visible text\nconst blogContent = $('.dorik-postContent-cnuauoa5').text().trim();\n\nreturn [\n  {\n    json: {\n      blogContent\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8c4889e9-8782-416f-903c-a84ac396d516",
      "name": "Translate a language",
      "type": "n8n-nodes-base.googleTranslate",
      "position": [
        1180,
        0
      ],
      "parameters": {
        "text": "={{ $json.fields.HTML }}",
        "translateTo": "fr"
      },
      "credentials": {
        "googleTranslateOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "3985dd10-9486-440e-bf0b-b147889ccbed",
      "name": "Update record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1440,
        0
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appP62U5MtSww1eeP",
          "cachedResultUrl": "https://airtable.com/appP62U5MtSww1eeP",
          "cachedResultName": "N8n experiment"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblHVSfUR71dToSif",
          "cachedResultUrl": "https://airtable.com/appP62U5MtSww1eeP/tblHVSfUR71dToSif",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "TRANSLATED": "={{ $json.translatedText }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "HTML",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "HTML",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TRANSLATED",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "TRANSLATED",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "HTML"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "dd3cf3e0-02e1-4d1c-9baf-321c8d1d51ec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -200
      ],
      "parameters": {
        "color": 3,
        "width": 440,
        "height": 520,
        "content": "## Extract the HTML and convert to text \n"
      },
      "typeVersion": 1
    },
    {
      "id": "cc314ca2-028b-45a8-a094-2a803d8868a1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        -200
      ],
      "parameters": {
        "width": 500,
        "height": 520,
        "content": "## Store the Text \n"
      },
      "typeVersion": 1
    },
    {
      "id": "13659161-f683-4f81-be40-6ee8c90b1760",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -200
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 520,
        "content": "## Translate"
      },
      "typeVersion": 1
    },
    {
      "id": "c1938b28-2ece-4a7f-8026-62d2c52f9858",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -200
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 520,
        "content": "## Store Translated Blog"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e67c0089-8e80-4640-a0ea-b6f22adbb439",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Create a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a record": {
      "main": [
        [
          {
            "node": "Translate a language",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate a language": {
      "main": [
        [
          {
            "node": "Update record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}