{"meta":{"instanceId":"workflow-ca9b4248","versionId":"1.0.0","createdAt":"2025-09-29T07:07:55.314615","updatedAt":"2025-09-29T07:07:55.314661","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration","nodes":[{"name":"Split In Batches","type":"n8n-nodes-base.splitInBatches","position":[3140,9383.397766717584],"parameters":{"options":{},"batchSize":1},"typeVersion":2,"id":"315ba687-d497-409c-9112-786e03d6fadf","notes":"This splitInBatches node performs automated tasks as part of the workflow."},{"name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[3080,9783.397766717584],"parameters":{"width":1249.1706015670397,"height":685.2594193361641,"content":"## URL META TAGS DATA\n**This part** is used to parse long link data like title, descraption, image all them served in header with tags called. [URL metadata]({{ $env.WEBHOOK_URL }}"},"typeVersion":1,"id":"fa1253c9-9a3e-4cbb-b82e-ca1e412d6bf5","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[5240,10223.397766717584],"parameters":{"color":4,"width":346.4519761795601,"height":241.68171599985524,"content":"## Switchy API Limits:\n- 10.000 links/day.\n- 1.000 links/hour max.\n- 16 links /minute max."},"typeVersion":1,"id":"87b08cb1-f726-4be9-ba53-2862eace8171","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"Get Headers","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[3160,10123.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"response":{"response":{"neverError":true,"fullResponse":true}},"allowUnauthorizedCerts":true}},"typeVersion":4.1,"id":"14f47b78-4b5d-4a4e-bbae-5b0efef4a994","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"OpenGraph API","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[3160,9923.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"response":{"response":{"neverError":true,"fullResponse":true}},"allowUnauthorizedCerts":true},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"},{"name":"Accept","value":"*/*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"Referer","value":"={{ $env.WEBHOOK_URL }}{{ $('API Auth').item.json.LongURL.urlEncode()}}"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"same-origin"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"cookie","value":"crisp-client%2Fsession%2Fbb1ac897-aa52-4f90-b0e1-e191cb403caf=session_a7a69e83-51f6-4a3b-a101-68fc6d33aca7;"}]}},"typeVersion":4.1,"id":"1ec125b6-4cd2-4276-a235-248b6f6ea31b","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"Meta tags Scraper - dub.sh","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[3160,10303.397766717584],"parameters":{"url":"{{ $env.API_BASE_URL }}","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"url","value":"={{ $item(\"0\").$node[\"API Auth\"].json[\"LongURL\"] }}"}]},"headerParameters":{"parameters":[{"name":"authority","value":"app.dub.co"},{"name":"accept","value":"*/*"},{"name":"accept-language","value":"en-GB,en;q=0.9,en-US;q=0.8"},{"name":"cache-control","value":"no-cache"},{"name":"dnt","value":"1"},{"name":"pragma","value":"no-cache"},{"name":"sec-ch-ua","value":"\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Microsoft Edge\";v=\"120\""},{"name":"sec-ch-ua-mobile","value":"?0"},{"name":"sec-ch-ua-platform","value":"\"Windows\""},{"name":"sec-fetch-dest","value":"empty"},{"name":"sec-fetch-mode","value":"cors"},{"name":"sec-fetch-site","value":"same-origin"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0"}]}},"notesInFlow":true,"typeVersion":4.1,"id":"36d11ef0-644e-42b6-834d-b5e009226853","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"IF OpenGraph invaild","type":"n8n-nodes-base.if","position":[3400,9903.397766717584],"parameters":{"options":{},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"b9f7d88d-4626-4e2c-a04c-ae8f9d4aed93","operator":{"type":"string","operation":"notEquals"},"leftValue":"={{ $ifEmpty($json.data,'Unauthorized access') }}","rightValue":"Unauthorized access"},{"id":"046b5c40-b6a4-434e-aa8e-d3b6c601f16d","operator":{"type":"string","operation":"notExists","singleValue":true},"leftValue":"={{ $json.body.error }}","rightValue":""}]}},"typeVersion":2,"id":"08c1932d-250f-46b0-8398-7456fed92c1f","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Parse headers","type":"n8n-nodes-base.html","position":[3360,10100],"parameters":{"options":{},"operation":"extractHtmlContent","extractionValues":{"values":[{"key":"YOUR_CREDENTIAL_HERE","attribute":"content","cssSelector":"meta[property^=\"og:title\"], meta[name=\"og:title\"], meta[property=\"twitter:title\"], meta[name=\"twitter:title\"]","returnValue":"attribute"},{"key":"YOUR_CREDENTIAL_HERE","attribute":"content","cssSelector":"meta[name=\"description\"], meta[property=\"og:description\"], meta[property=\"twitter:description\"]","returnValue":"attribute"},{"key":"YOUR_CREDENTIAL_HERE","attribute":"content","cssSelector":"meta[property^=\"og:image\"], meta[name=\"og:image\"], meta[property=\"twitter:image\"], meta[name=\"twitter:image\"]","returnValue":"attribute"},{"key":"YOUR_CREDENTIAL_HERE","attribute":"href","cssSelector":"link[rel=\"shortcut icon\"], link[rel=\"icon\"], link[rel=\"apple-touch-icon\"], link[rel=\"apple-touch-startup-image\"]","returnValue":"attribute"},{"key":"YOUR_CREDENTIAL_HERE","attribute":"href","cssSelector":"link[rel=\"preload\"][as=\"image\"],link[as=\"image\"]","returnValue":"attribute"},{"key":"YOUR_CREDENTIAL_HERE","cssSelector":"title","returnValue":"html"}]}},"typeVersion":1,"id":"3e409d7a-d3bf-4f92-851f-ef22f89e2066","notes":"This html node performs automated tasks as part of the workflow."},{"name":"If - Enable ScreenShots (yes to enable)","type":"n8n-nodes-base.if","position":[4040,10080],"parameters":{"options":{},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"cfcdcf45-822e-4e7a-bd7f-5fb321f96acd","operator":{"type":"string","operation":"equals"},"leftValue":"={{ ($if(\n  $('API Auth').item.json[\"OpenGraph Image Mode\"] = 'screenshot',\n  \"screenshot\")) }}","rightValue":"=screenshot"}]}},"typeVersion":2,"id":"04c4ac31-9b89-4b2b-a440-ad721e47dd96","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[4340,9783.397766717584],"parameters":{"color":3,"width":885.4276629872791,"height":682.7545654243127,"content":"# Screenshot stack"},"typeVersion":1,"id":"88365cb1-ee82-4cd4-96f4-98941ab09eb2","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"API Auth","type":"n8n-nodes-base.set","position":[3600,9160],"parameters":{"fields":{"values":[{"name":"OpenGraph Image Mode","stringValue":"={{ $json['What\\'s OG Image method you like ?'].toLowerCase() }}"},{"name":"Dark Mode ?","type":"booleanValue","booleanValue":"={{ $json['With your brand, Do you Like dark mode ?'].replace('no','false').replace('yes','true') }}"},{"name":"Brand Name","stringValue":"NodeMation"},{"name":"Switchy API Key","stringValue":"={{ $json['What\\'s your Switchy API Key'] }}"},{"name":"LongURL","stringValue":"={{ $json['What\\'s Your LongURL ?'].match(/\\b((?:https?|ftp):\\/\\/[^\\s/$.?#].[^\\s]*)/g)[0] }}"},{"name":"Scan LongURL","stringValue":"={{ $json['scan Long URLs from virus/Phishing ? (Shorting a phishing URL will ban your domain from SEO)'] }}"},{"name":"Custom slug","stringValue":"=<Optional: Slug is the path of shortened URL - default is random 5 chars> "},{"name":"tags","stringValue":"=<Optional: Add tags if you need, each keyword seperated by \",\" for example: Marketing, Media, Shortened> "},{"name":"Switchy Folder ID","stringValue":"<Optional: Enter Your Switchy Folder ID>"},{"name":"Custom Domain (CNAME)","stringValue":"=<Optional: Use your custom domain linked to Switchy, otherwise keep it empty to use default domain swiy.co>"}]},"include":"none","options":{}},"typeVersion":3.2,"id":"cce3413e-339d-4fcd-8533-def0d3bb63cb","notes":"This set node performs automated tasks as part of the workflow."},{"name":"Method 1 - META","type":"n8n-nodes-base.set","position":[3620,9923.397766717584],"parameters":{"fields":{"values":[{"name":"ogTitle","stringValue":"={{\n      // We used IFempty of title then use descraption, if the title giving no title output value then replace with descraption value, if no value for both then use empty value output.\n      // The domain name (Host)\n      // if the image url not found then use long URL host.\n \n($ifEmpty($json[\"body\"][\"metadata\"][\"ogTitle\"], ($json[\"body\"][\"metadata\"][\"domain\"], $(\"API Auth\").item.json[\"LongURL\"])\n        // This Regex to delete Any https:// or path from the url.\n        .match(/https?:\\/\\/[^\\/]+/)[0]\n        .replace(/https?:\\/\\//, \"\")\n      ))\n }}"},{"name":"ogDescription","stringValue":"=  {{\n    // We used IFempty of descraption then use title, if the descraption giving no descraption output value then replace with title value, if no value for both then use empty value output.\n    $ifEmpty(\n      $json[\"body\"][\"metadata\"][\"ogDescription\"],\n      $json[\"body\"][\"metadata\"][\"ogSiteName\"]\n    ) || \"\"\n  }}"},{"name":"ogImage","stringValue":"={{\n  // Constructing the base URL for the CDN\n  \"{{ $env.WEBHOOK_URL }}\" +\n  // Adding the title, URL encoded\n  ($ifEmpty($json[\"body\"][\"metadata\"][\"ogTitle\"], $json[\"body\"][\"metadata\"][\"ogSiteName\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Adding the description, URL encoded\n  ($ifEmpty($json[\"body\"][\"metadata\"][\"ogDescription\"], $json[\"body\"][\"metadata\"][\"ogTitle\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Handling different OpenGraph Image Modes\n  (\n    $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'screenshot',\n      \"<SCR>\",\n      $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'brand',\n        (\n          \"{{ $env.WEBHOOK_URL }}\" +\n          ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n            .replace(\"false\", \"white/\")\n            .replace(\"true\", \"dark/\") +\n          (\n            (`%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20`+ $(\"API Auth\").item.json[\"Brand Name\"].slice(0,18) + '%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C') ||\n            $json[\"body\"][\"metadata\"][\"ogTitle\"].toUpperCase() ||\n            $json[\"body\"][\"metadata\"][\"ogDescription\"].toUpperCase() ||\n            \"Short Link\"\n          ) + '.jpg'\n        ).urlEncode(),\n        $ifEmpty(\n          $json[\"body\"][\"metadata\"][\"ogImage\"][\"url\"] || $json[\"body\"][\"metadata\"][\"image\"],\n          \"{{ $env.WEBHOOK_URL }}\" +\n            ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n              .replace(\"false\", \"white/\")\n              .replace(\"true\", \"dark/\") +\n            \"Default.jpg\"\n        ).urlEncode()\n      )\n    )\n  ) +\n  \"/og.png\"\n}}"},{"name":"Favicon","stringValue":"={{ $ifEmpty($json[\"body\"][\"metadata\"][\"favicon\"],\n(\n      // Get the Favicon url, if not available then generate api request to get it with:\n      \"{{ $env.WEBHOOK_URL }}\" +\n        // Get the image failed to export how from it if not found then use LongURL.\n        $ifEmpty(\n          $json[\"body\"][\"metadata\"][\"fullUrl\"],\n          $('API Auth').item.json[\"LongURL\"]\n        )\n          // This Regex to delete Any https:// or path from the url.\n          .match(/https?:\\/\\/[^\\/]+/)[0]\n          .replace(/https?:\\/\\//, \"\") +\n        // This Parameter to resize the favicon into 32pixels.\n        \"?s=32\"\n)) }}"}]},"include":"none","options":{}},"typeVersion":3.2,"id":"e6f43102-061b-4b15-aa3c-d7f35a5fe9c1","notes":"This set node performs automated tasks as part of the workflow."},{"name":"Convert to File","type":"n8n-nodes-base.convertToFile","position":[4440,10263.397766717584],"parameters":{"options":{"dataIsBase64":true},"operation":"toBinary","sourceProperty":"data"},"typeVersion":1,"id":"5ccaaab8-6e7a-4631-a58c-c7c7f6dbf473","notes":"This convertToFile node performs automated tasks as part of the workflow."},{"name":"Final Data","type":"n8n-nodes-base.set","position":[4980,9883.397766717584],"parameters":{"fields":{"values":[{"name":"Title","stringValue":"={{ $item(\"0\").$node[\"Final Meta\"].json[\"data\"][\"0\"][\"ogTitle\"] }}"},{"name":"Description","stringValue":"={{ $item(\"0\").$node[\"Final Meta\"].json[\"data\"][\"0\"][\"ogDescription\"].replace(/\\s{2,}/g, ' ').replace(/^\\s+|\\s{3,}/g, '') }}"},{"name":"ogImage","stringValue":"={{ ($('Host OGImage').item.json[\"content\"][\"download_url\"]||'').replace('{{ $env.WEBHOOK_URL }}','{{ $env.WEBHOOK_URL }}')}}"},{"name":"Favicon","stringValue":"={{ ($item(\"0\").$node[\"Host Favicon\"].json[\"content\"][\"download_url\"]||'').replace('{{ $env.WEBHOOK_URL }}','{{ $env.WEBHOOK_URL }}')}}"},{"name":"=url","stringValue":"={{ $('API Auth').item.json.LongURL }}"},{"name":"slug","stringValue":"={{ $('API Auth').item.json[\"Custom slug\"] }}"},{"name":"tags","stringValue":"={{ $('API Auth').item.json.tags }}"},{"name":"folderId","stringValue":"={{ $('API Auth').item.json[\"Switchy Folder ID\"] }}"},{"name":"api","stringValue":"={{ $('API Auth').item.json[\"Switchy API Key\"] }}"},{"name":"name","stringValue":"={{ $('API Auth').item.json[\"Brand Name\"] }}"},{"name":"domain","stringValue":"={{ $('API Auth').item.json['Custom Domain (CNAME)'] }}"}]},"include":"none","options":{"dotNotation":true,"ignoreConversionErrors":true}},"typeVersion":3.2,"id":"e6f162a9-8b23-45a5-8799-7cf83a9ac57b","notes":"This set node performs automated tasks as part of the workflow."},{"name":"CREATE","type":"n8n-nodes-base.httpRequest","notes":"Create Link","position":[5280,9883.397766717584],"parameters":{"url":"{{ $env.API_BASE_URL }}","method":"POST","options":{"batching":{"batch":{"batchSize":15,"batchInterval":60000}},"redirect":{"redirect":{}},"response":{"response":{"neverError":true,"fullResponse":true}},"allowUnauthorizedCerts":true},"jsonBody":"={  \"link\": {\n    \"url\": \"{{ $json[\"url\"] }}\",\n\n    {{($ifEmpty(('\"tags\": \"' + $json[\"tags\"]+'\",'),'')\n// Replace Undefiend with default one, and default template texts with none.\n.replace('\"tags\": \"undefined\",','')\n.replace('\"tags\": \"<Optional: Add tags if you need, each keyword seperated by \",\" for example: Marketing, Media, Shortened> \",','')\n) }}\n\n    {{($ifEmpty(('\"domain\": \"' + $json[\"domain\"]+'\",'),'')\n// Replace Undefiend with default one, and default template texts with none.\n.replace('\"undefined\",','\"swiy.co\",')\n.replace('\"<Optional: Use your custom domain linked to Switchy, otherwise keep it empty to use default domain swiy.co>\",','\"swiy.co\",')) }}\n\n    \"title\": \"{{$json[\"Title\"].slice(0,60)}}\",\n\n    {{($ifEmpty(('\"description\": \"' + $json[\"Description\"].slice(0,62)+'...\",'),'')\n.replace('\"description\": \"undefined\",','')) }}\n\n    {{($ifEmpty(('\"image\": \"' + $json[\"ogImage\"]+'\",'),'')\n.replace('\"image\": \"undefined\",','')) }}\n\n    \"id\": \"{{$ifEmpty($json[\"slug\"].replace('<Optional: Slug is the path of shortened URL - default is random 5 chars> ',''),Array.from({ length: 5 }, () => String.fromCharCode(Math.floor(Math.random() * 26) + 97)).join(''))}}\",\n\n    {{($ifEmpty(('\"folderId\": \"' + $json[\"folderId\"]+'\",'),'')\n.replace('\"folderId\": undefined,','')\n.replace('\"folderId\": \"<Optional: Enter Your Switchy Folder ID>\",','')) }}\n\n    \"favicon\": \"{{$json[\"Favicon\"]}}\",\n\n    \"note\": \"{{ 'Created through N8N.io Workflow name: ' + $workflow.name }}\"  }}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Api-Authorization","value":"={{ $item(\"0\").$node[\"Final Data\"].json[\"api\"] }}"}]}},"notesInFlow":true,"typeVersion":4.1,"alwaysOutputData":true,"id":"3c4ebbc4-336e-4271-b0b3-7a447525dac0"},{"name":"UPDATE","type":"n8n-nodes-base.httpRequest","position":[5280,10043.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","method":"PUT","options":{"batching":{"batch":{"batchSize":15,"batchInterval":60000}},"redirect":{"redirect":{}},"response":{"response":{"neverError":true,"fullResponse":true}},"allowUnauthorizedCerts":true},"jsonBody":"={  \"link\": {\n    \"url\": \"{{ $item(\"0\").$node[\"Final Data\"].json[\"url\"] }}\",\n\n    {{($ifEmpty(('\"tags\": \"' + $json[\"tags\"]+'\",'),'')\n// Replace Undefiend with default one, and default template texts with none.\n.replace('\"tags\": \"undefined\",','')\n.replace('\"tags\": \"<Optional: Add tags if you need, each keyword seperated by \",\" for example: Marketing, Media, Shortened> \",','')\n) }}\n\n    {{($ifEmpty(('\"domain\": \"' + $json[\"domain\"]+'\",'),'')\n// Replace Undefiend with default one, and default template texts with none.\n.replace('\"undefined\",','\"swiy.co\",')\n.replace('\"<Optional: Use your custom domain linked to Switchy, otherwise keep it empty to use default domain swiy.co>\",','\"swiy.co\",')) }}\n\n    \"title\": \"{{ $item(\"0\").$node[\"Final Data\"].json[\"Title\"].slice(0,60) }}\",\n\n    {{($ifEmpty(('\"description\": \"' + $item(\"0\").$node[\"Final Data\"].json[\"Description\"].slice(0,62)+'...\",'),'')\n.replace('\"description\": \"undefined\",','')) }}\n\n    {{($ifEmpty(('\"image\": \"' + $json[\"ogImage\"]+'\",'),'')\n.replace('\"image\": \"undefined\",','')) }}\n\n    {{($ifEmpty(('\"folderId\": \"' + $json[\"folderId\"]+'\",'),'')\n.replace('\"folderId\": undefined,','')\n.replace('\"folderId\": \"<Optional: Enter Your Switchy Folder ID>\",','')) }}\n\n    \"favicon\": \"{{$item(\"0\").$node[\"Final Data\"].json[\"Favicon\"]}}\",\n\n    \"note\": \"{{ 'Created through N8N.io Workflow name: ' + $workflow.name }}\"  }}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Api-Authorization","value":"={{ $item(\"0\").$node[\"Final Data\"].json[\"api\"] }}"}]}},"typeVersion":4.1,"alwaysOutputData":true,"id":"b0b0091d-1c7e-44a2-9f56-afa3232013d3","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","disabled":true,"position":[5240,9783.397766717584],"parameters":{"color":4,"width":344.6623616873581,"height":418.2992490141105,"content":"## Switchy API\n**Create or Update** Link. [Based on their API docs]({{ $env.WEBHOOK_URL }}"},"typeVersion":1,"id":"aaf91137-8b1f-4406-888b-f4258d88d9e9","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"IF Slug available","type":"n8n-nodes-base.if","position":[5420,9883.397766717584],"parameters":{"conditions":{"string":[{"value1":"={{ $json.statusCode }}","value2":"201","operation":"regex"}]}},"typeVersion":1,"id":"c6f48705-3a73-46cf-9e48-77f22c527fa9","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Final Meta","type":"n8n-nodes-base.aggregate","position":[3880,10080],"parameters":{"options":{"includeBinaries":true},"aggregate":"aggregateAllItemData"},"typeVersion":1,"id":"4c834399-22e9-44a4-bf45-0cc9cc1df801","notes":"This aggregate node performs automated tasks as part of the workflow."},{"name":"Host Screenshot","type":"n8n-nodes-base.github","position":[4820,9883.397766717584],"parameters":{"owner":{"__rl":true,"mode":"list","value":"ARHAEEM","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"ARHAEEM"},"filePath":"=screenshots/{{$(\"API Auth\").item.json[\"LongURL\"].match(/https?:\\/\\/[^\\/]+/)[0].replace(/https?:\\/\\//, \"\")}}/scr/{{(Array.from({ length: 5 }, () => String.fromCharCode(Math.floor(Math.random() * 26) + 97)).join(''))}}.png","resource":"file","binaryData":true,"repository":{"__rl":true,"mode":"list","value":"n8n-templates-demos","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"n8n-templates-demos"},"commitMessage":"={{ $('API Auth').item.json.LongURL }}","binaryPropertyName":"=data"},"typeVersion":1,"id":"dfa3e154-3bfd-4aa7-8973-3378a46ca7e1","notes":"This github node performs automated tasks as part of the workflow."},{"name":"Host OGImage","type":"n8n-nodes-base.github","position":[4660,10223.397766717584],"parameters":{"owner":{"__rl":true,"mode":"list","value":"ARHAEEM","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"ARHAEEM"},"filePath":"=screenshots/{{$(\"API Auth\").item.json[\"LongURL\"].match(/https?:\\/\\/[^\\/]+/)[0].replace(/https?:\\/\\//, \"\")}}/og/{{(Array.from({ length: 5 }, () => String.fromCharCode(Math.floor(Math.random() * 26) + 97)).join(''))}}.png","resource":"file","binaryData":true,"repository":{"__rl":true,"mode":"list","value":"n8n-templates-demos","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"n8n-templates-demos"},"commitMessage":"={{ $('API Auth').item.json.LongURL }}","binaryPropertyName":"=data"},"typeVersion":1,"id":"3b3338ae-ded6-40d4-a3d5-c043886bd9d7","notes":"This github node performs automated tasks as part of the workflow."},{"name":"Host Favicon","type":"n8n-nodes-base.github","position":[4980,10223.397766717584],"parameters":{"owner":{"__rl":true,"mode":"list","value":"ARHAEEM","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"ARHAEEM"},"filePath":"=screenshots/{{$(\"API Auth\").item.json[\"LongURL\"].match(/https?:\\/\\/[^\\/]+/)[0].replace(/https?:\\/\\//, \"\")}}/icon/{{(Array.from({ length: 5 }, () => String.fromCharCode(Math.floor(Math.random() * 26) + 97)).join(''))}}.png","resource":"file","binaryData":true,"repository":{"__rl":true,"mode":"list","value":"n8n-templates-demos","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"n8n-templates-demos"},"commitMessage":"={{ $('API Auth').item.json.LongURL }}","binaryPropertyName":"=data"},"typeVersion":1,"id":"34c02ffd-1e63-47af-9061-57c67a3de6cd","notes":"This github node performs automated tasks as part of the workflow."},{"name":"Edit Fields","type":"n8n-nodes-base.set","position":[4820,10063.397766717584],"parameters":{"fields":{"values":[{"name":"download_url","stringValue":"={{ $json.content.download_url }}"}]},"options":{}},"typeVersion":3.2,"id":"613a96e4-2552-4b11-8e37-6ce97372cd3e","notes":"This set node performs automated tasks as part of the workflow."},{"name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[2380,9060],"parameters":{"width":682.2425599837106,"height":1405.2214458171302,"content":"# README\n## N8N META Config\n### 1- **Opengraph Image mode**: `screenshot` or `source` or `brand`\n### - **screenshot**: _take a screenshot for web page based on longurl._\n[![Screenshort Mode Demo]({{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }}\n### - **source**: _scrape the source longurl og image and use it_\n[![Source Mode Demo]({{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }}\n### -  **brand**: _Generate blank background, color based on `Dark Mode` option_\n[![Brand Mode Demo Dark]({{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }} [![Brand Mode Demo White]({{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }}\n### 2- **Dark Mode**: `true` or `false` (_Working with `brand` OGI mode only._)\n- **true**: generate **black** patteren as background og image for the texts.\n- **false**: generate **white** patteren as background og image for the texts.\n### 3- **Brand Name**: Used for `brand` ogi background. The limit of brand name is 18 characters total.\n\n\n## Switchy API Workflow Configuration\n### This is part of Switchy API config i covered in this workflow.\n| Input Field           | Description                                      |\n|-----------------------|--------------------------------------------------|\n| **`Switchy API Key`**       | _API Key for Switchy integration._                 |\n| **`LongURL`**               | _The long URL to be shortened._                    |\n| **`Custom slug`**           | _Custom slug for the shortened URL._               |\n| **`tags`**                  | _Tags associated with the link._                   |\n| **`Switchy Folder ID`**     | _ID of the Switchy folder to use._                 |\n| **`Custom Domain (CNAME)`** | _Custom domain linked to Switchy._                 |\n\n\n### This is public APIs I've Used in Workflow\n#### Meta Data Stack\n- **Manual Get Headers**: Custom HTTP request to fetch headers.\n- **Dub.sh**: Scraping meta tags from web pages.\n- **OpenGraph API**: Using OpenGraph to retrieve meta information.\n#### Screenshot Stack\n- **Method 1 - SCR**: First method for taking screenshots (API name microlink).\n- **Method 2 - SCR**: Second method for taking screenshots (API name pxl.to)."},"typeVersion":1,"id":"50618900-abba-4100-9fae-e9d0750af501","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"Download final OG","type":"n8n-nodes-base.httpRequest","notes":"Download Final OGI","position":[4980,10063.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"allowUnauthorizedCerts":true}},"notesInFlow":true,"typeVersion":4.1,"id":"1c230a58-8925-4614-89ff-2bc826b44458"},{"name":"Download Favicon","type":"n8n-nodes-base.httpRequest","position":[4820,10223.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"allowUnauthorizedCerts":true}},"typeVersion":4.1,"id":"26de229b-1c5d-4e2b-86f0-7527f7052f2c","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"Method 2 - META","type":"n8n-nodes-base.set","position":[3500,10100],"parameters":{"fields":{"values":[{"name":"ogTitle","stringValue":"={{\n      // We used IFempty of title then use descraption, if the title giving no title output value then replace with descraption value, if no value for both then use empty value output.\n      // The domain name (Host)\n      // if the image url not found then use long URL host.\n \n($ifEmpty($json[\"ogTitle\"], ($(\"API Auth\").item.json[\"LongURL\"])\n        // This Regex to delete Any https:// or path from the url.\n        .match(/https?:\\/\\/[^\\/]+/)[0]\n        .replace(/https?:\\/\\//, \"\")\n      ))\n }}"},{"name":"ogDescription","stringValue":"={{ (($ifEmpty($json.ogDescription , $json[\"ogTitle\"])) || 'Visit Now') }}"},{"name":"ogImage","stringValue":"={{  // Constructing the base URL for the CDN\n  \"{{ $env.WEBHOOK_URL }}\" +\n  // Adding the title, URL encoded\n  ($ifEmpty($json[\"ogTitle\"], $('API Auth').item.json[\"Brand Name\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Adding the description, URL encoded\n  ($ifEmpty($json[\"ogDescription\"], $json[\"ogTitle\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Handling different OpenGraph Image Modes\n  (\n    $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'screenshot',\n      \"<SCR>\",\n      $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'brand',\n        (\n          \"{{ $env.WEBHOOK_URL }}\" +\n          ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n            .replace(\"false\", \"white/\")\n            .replace(\"true\", \"dark/\") +\n          (\n            (`%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20`+ $(\"API Auth\").item.json[\"Brand Name\"].slice(0,18) + '%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C') ||\n            $json[\"ogTitle\"].toUpperCase() ||\n            $json[\"ogDescription\"].toUpperCase() ||\n            \"Short Link\"\n          ) + '.jpg'\n        ).urlEncode(),\n        $ifEmpty(\n          $json[\"ogImage\"] || $json[\"Image\"],\n          \"{{ $env.WEBHOOK_URL }}\" +\n            ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n              .replace(\"false\", \"white/\")\n              .replace(\"true\", \"dark/\") +\n            \"Default.jpg\"\n        ).urlEncode()\n      )\n    )\n  ) +\n  \"/og.png\"\n}}"},{"name":"Favicon","stringValue":"={{ $ifEmpty($json[\"favicon\"],\n(\n// Get the Favicon url, if not available then generate api request to get it with:\n\"{{ $env.WEBHOOK_URL }}\" +\n// Get the image failed to export how from it if not found then use LongURL.\n$ifEmpty($('API Auth').item.json[\"LongURL\"],\n''\n)\n// This Regex to delete Any https:// or path from the url.\n.match(/https?:\\/\\/[^\\/]+/)[0]\n.replace(/https?:\\/\\//, \"\") +\n// This Parameter to resize the favicon into 32pixels.\n\"?s=32\"\n)) }}"}]},"include":"none","options":{}},"typeVersion":3.2,"id":"8a08f5d6-4054-426b-97eb-9d0d758afe12","notes":"This set node performs automated tasks as part of the workflow."},{"name":"Stop and Error","type":"n8n-nodes-base.stopAndError","position":[4040,10320],"parameters":{"errorMessage":"META Stack need fix, report to creator through n8n community 'Ans'."},"typeVersion":1,"id":"d3b9fcd1-80d9-4459-aa98-eb05b7e7bee2","notes":"This stopAndError node performs automated tasks as part of the workflow."},{"name":"Method 3 - META1","type":"n8n-nodes-base.set","position":[3620,10283],"parameters":{"fields":{"values":[{"name":"ogTitle","stringValue":"={{\n      // We used IFempty of title then use descraption, if the title giving no title output value then replace with descraption value, if no value for both then use empty value output.\n      // The domain name (Host)\n      // if the image url not found then use long URL host.\n \n($ifEmpty($json[\"title\"], ($(\"API Auth\").item.json[\"LongURL\"])\n        // This Regex to delete Any https:// or path from the url.\n        .match(/https?:\\/\\/[^\\/]+/)[0]\n        .replace(/https?:\\/\\//, \"\")\n      ))\n }}"},{"name":"ogDescription","stringValue":"={{ (($ifEmpty($json.description , $json[\"title\"])) || 'Visit Now') }}"},{"name":"ogImage","stringValue":"={{  // Constructing the base URL for the CDN\n  \"{{ $env.WEBHOOK_URL }}\" +\n  // Adding the title, URL encoded\n  ($ifEmpty($json[\"title\"], $('API Auth').item.json[\"Brand Name\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Adding the description, URL encoded\n  ($ifEmpty($json[\"description\"], $json[\"title\"]).urlEncode() || \"\") +\n  \"/\" +\n  // Handling different OpenGraph Image Modes\n  (\n    $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'screenshot',\n      \"<SCR>\",\n      $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'brand',\n        (\n          \"{{ $env.WEBHOOK_URL }}\" +\n          ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n            .replace(\"false\", \"white/\")\n            .replace(\"true\", \"dark/\") +\n          (\n            (`%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20`+ $(\"API Auth\").item.json[\"Brand Name\"].slice(0,18) + '%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C') ||\n            $json[\"title\"].toUpperCase() ||\n            $json[\"description\"].toUpperCase() ||\n            \"Short Link\"\n          ) + '.jpg'\n        ).urlEncode(),\n        $ifEmpty(\n          $json[\"image\"],\n          \"{{ $env.WEBHOOK_URL }}\" +\n            ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n              .replace(\"false\", \"white/\")\n              .replace(\"true\", \"dark/\") +\n            \"Default.jpg\"\n        ).urlEncode()\n      )\n    )\n  ) +\n  \"/og.png\"\n}}"},{"name":"Favicon","stringValue":"={{ $ifEmpty($json[\"favicon\"],\n(\n// Get the Favicon url, if not available then generate api request to get it with:\n\"{{ $env.WEBHOOK_URL }}\" +\n// Get the image failed to export how from it if not found then use LongURL.\n$ifEmpty($('API Auth').item.json[\"LongURL\"],\n''\n)\n// This Regex to delete Any https:// or path from the url.\n.match(/https?:\\/\\/[^\\/]+/)[0]\n.replace(/https?:\\/\\//, \"\") +\n// This Parameter to resize the favicon into 32pixels.\n\"?s=32\"\n)) }}"}]},"include":"none","options":{}},"typeVersion":3.2,"id":"9ad65721-f589-4e06-961b-97f167aa3b95","notes":"This set node performs automated tasks as part of the workflow."},{"name":"Method 1 - SCR","type":"n8n-nodes-base.httpRequest","notes":"SCR API","onError":"continueErrorOutput","position":[4440,9863.397766717584],"parameters":{"url":"{{ $env.API_BASE_URL }}","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"url","value":"={{ $env.API_BASE_URL }}{{ $item(\"0\").$node[\"API Auth\"].json[\"LongURL\"].urlEncode() }}&screenshot=true&meta=true&embed=screenshot.url"}]},"headerParameters":{"parameters":[{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"},{"name":"Accept","value":"application/json, text/plain, */*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"Origin","value":"{{ $env.WEBHOOK_URL }}"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Referer","value":"{{ $env.WEBHOOK_URL }}"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"same-site"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"notesInFlow":true,"typeVersion":4.1,"id":"41e54d16-61fb-4165-95f9-7aa6bd2dc45b"},{"name":"Method 2 - SCR","type":"n8n-nodes-base.httpRequest","notes":"Optional ","onError":"continueErrorOutput","position":[4440,10083.397766717584],"parameters":{"url":"{{ $env.API_BASE_URL }}","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"destination","value":"={{ $item(\"0\").$node[\"API Auth\"].json[\"LongURL\"] }}"},{"name":"size","value":"meta"},{"name":"width","value":1200},{"name":"height","value":628},{"name":"full","value":false}]},"headerParameters":{"parameters":[{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"},{"name":"Accept","value":"*/*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"Origin","value":"{{ $env.WEBHOOK_URL }}"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"same-site"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"notesInFlow":true,"typeVersion":4.1,"id":"463dcfaa-d1eb-4a2f-9661-2422cbe515b7"},{"name":"Final SCR","type":"n8n-nodes-base.aggregate","position":[4660,9883.397766717584],"parameters":{"options":{"includeBinaries":true},"aggregate":"aggregateAllItemData"},"typeVersion":1,"id":"0f3bb349-54d9-471a-9e09-2a463ca43a7f","notes":"This aggregate node performs automated tasks as part of the workflow."},{"name":"Stop And Error","type":"n8n-nodes-base.stopAndError","position":[4660,10063.397766717584],"parameters":{"errorMessage":"SCR Stack need fix, report to creator through n8n community 'Ans'."},"typeVersion":1,"id":"e6d71593-c607-4630-a924-827d7a76d596","notes":"This stopAndError node performs automated tasks as part of the workflow."},{"name":"Shortened URL","type":"n8n-nodes-base.set","position":[5420,10043.397766717584],"parameters":{"values":{"string":[{"name":"Shortened URL","value":"=https://{{ $json.body.domain }}/{{ $json.body.id }}"},{"name":"OG Method","value":"={{ $('API Auth').item.json['OpenGraph Image Mode'] }}"}]},"options":{},"keepOnlySet":true},"typeVersion":2,"id":"954700c2-dda8-4539-ae5f-17af9920c35b","notes":"This set node performs automated tasks as part of the workflow."},{"name":"n8n Form Trigger","type":"n8n-nodes-base.formTrigger","position":[3140,9183],"webhookId":"4d7636c2-aa25-4a90-8f9c-e421166d21ab","parameters":{"path":"switchy","formTitle":"Switchy URL Shortener","formFields":{"values":[{"fieldType":"textarea","fieldLabel":"What's your Switchy API Key","requiredField":true},{"fieldLabel":"What's Your LongURL ?","requiredField":true},{"fieldType":"dropdown","fieldLabel":"What's OG Image method you like ?","fieldOptions":{"values":[{"option":"Screenshot"},{"option":"Source"},{"option":"brand"}]},"requiredField":true},{"fieldType":"dropdown","fieldLabel":"With your brand, Do you Like dark mode ?","fieldOptions":{"values":[{"option":"no"},{"option":"yes"}]},"requiredField":true},{"fieldType":"dropdown","fieldLabel":"scan Long URLs from virus/Phishing ? (Shorting a phishing URL will ban your domain from SEO)","fieldOptions":{"values":[{"option":"No, Skip Scan part."},{"option":"Yes, Scan all Links."}]},"requiredField":true}]},"responseMode":"responseNode","formDescription":"This is demo simple of Switchy URL shortener."},"typeVersion":2,"id":"61eddf94-c400-48ba-a06f-a4af1521d372","notes":"This formTrigger node performs automated tasks as part of the workflow."},{"name":"Respond to Webhook","type":"n8n-nodes-base.respondToWebhook","position":[3140,9603.397766717584],"parameters":{"options":{},"respondWith":"text","responseBody":"={{ $json['Shortened URL'] }}"},"typeVersion":1,"id":"120392aa-e2e6-4146-a202-db9cf61cf137","notes":"This respondToWebhook node performs automated tasks as part of the workflow."},{"name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3080,9063.397766717584],"parameters":{"width":365.4663416508872,"height":698.8834639756606,"content":"## URL Preparing And Scanning\n"},"typeVersion":1,"id":"f6aa3772-7c52-4b0b-8881-133d63feaf03","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"Scan URL (Community)","type":"n8n-nodes-base.httpRequest","position":[3900,9163],"parameters":{"url":"{{ $env.WEBHOOK_URL }}","options":{"redirect":{"redirect":{}},"response":{"response":{}},"allowUnauthorizedCerts":true},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"url","value":"={{ $('API Auth').item.json.LongURL.match(/^(?:https?:\\/\\/)?(?:[^@\\n]+@)?(?:www\\.)?([^:\\/\\n?]+)/im)[1] }}"},{"name":"insert","value":"0"}]},"headerParameters":{"parameters":[{"name":"Accept","value":"application/json, text/plain, */*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Referer","value":"{{ $env.WEBHOOK_URL }}"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"same-origin"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"typeVersion":4.1,"id":"004333cb-a13f-4617-b065-c4943193a547","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[3460,9063.397766717584],"parameters":{"width":1102.2526655123636,"height":698.8834639756606,"content":"## URL Preparing\nWe're using this side to control everything."},"typeVersion":1,"id":"d350a829-1f24-4011-9682-90142c344848","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[3840,9063],"parameters":{"color":7,"width":732.5923943084913,"height":698.8834639756606,"content":"‌ ‌ ‌‌ ‌ ‌ ‌ ‌‌ ‌ ‌ ‌ ‌‌ ‌ ‌ ‌‌ ‌ ‌‌ ‌  ‌‌ ‌ ‌ ‌ ‌‌ ‌ ![Safe Web]({{ $env.WEBHOOK_URL }} ‌ ‌‌ ‌ ‌‌ ‌ ‌‌![Safe Web]({{ $env.WEBHOOK_URL }} ‌ ‌‌ ‌ ‌‌ ‌ ‌‌![Safe Web]({{ $env.WEBHOOK_URL }}"},"typeVersion":1,"id":"c7727f8c-0ec2-41f7-b191-a5f4bf015285","notes":"This stickyNote node performs automated tasks as part of the workflow."},{"name":"If Node","type":"n8n-nodes-base.if","position":[4060,9160],"parameters":{"options":{},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"4b55880c-53dc-47d3-acc5-ecf5166bcce5","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.rating }}","rightValue":"g"},{"id":"c412970c-402b-4ae1-ad36-385ecc563d7a","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.rating }}","rightValue":"r"}]}},"typeVersion":2,"id":"b30ee34b-19b2-4c34-824c-72b771bfd615","notes":"This if node performs automated tasks as part of the workflow."},{"name":"If1","type":"n8n-nodes-base.if","position":[3900,9340],"parameters":{"options":{},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"4b55880c-53dc-47d3-acc5-ecf5166bcce5","operator":{"type":"number","operation":"gte"},"leftValue":"={{ $('Scan URL (Community)').item.json.reviewCount }}","rightValue":1}]}},"typeVersion":2,"id":"4ca7f835-6349-472f-9520-1a9eee55062e","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Check Reviews (Community)","type":"n8n-nodes-base.httpRequest","position":[3900,9520],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"response":{"response":{}},"allowUnauthorizedCerts":true},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"sortType","value":"1"},{"name":"pageNo","value":"1"},{"name":"pageSize","value":"2"}]},"headerParameters":{"parameters":[{"name":"Accept","value":"application/json, text/plain, */*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Referer","value":"={{ $env.WEBHOOK_URL }}{{ $('Scan URL (Community)').item.json.url }}"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"same-origin"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"typeVersion":4.1,"id":"770a0534-2d34-41c2-b632-9ed59d81d08d","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"Norton","type":"n8n-nodes-base.set","position":[4060,9340],"parameters":{"fields":{"values":[{"name":"Risk Rate","stringValue":"={{ $('Scan URL (Community)').item.json.rating }}"},{"name":"Community Rating","stringValue":"={{ $('Scan URL (Community)').item.json.userRating+'\\/5' }}"},{"name":"Ban","type":"booleanValue","booleanValue":"={{ $('Scan URL (Community)').item.json.globalRestriction }}"}]},"options":{}},"typeVersion":3.2,"id":"ff3eb843-6dc2-4e7d-98d0-2c256a2b73b0","notes":"This set node performs automated tasks as part of the workflow."},{"name":"bitdefender","type":"n8n-nodes-base.set","position":[4420,9343.397766717584],"parameters":{"fields":{"values":[{"name":"safe","type":"booleanValue","booleanValue":"={{ $json.safe.is }}"},{"name":"blocklist score","stringValue":"={{ $item(\"0\").$node[\"HTML\"].json[\"result\"] }}"}]},"options":{}},"typeVersion":3.2,"id":"1505e569-f64f-40ab-b4d2-debb7538bd25","notes":"This set node performs automated tasks as part of the workflow."},{"name":"HTML","type":"n8n-nodes-base.html","position":[4260,9343.397766717584],"parameters":{"options":{},"operation":"extractHtmlContent","extractionValues":{"values":[{"key":"YOUR_CREDENTIAL_HERE","cssSelector":".label"}]}},"typeVersion":1,"id":"5031e872-c5f2-4a0c-adf9-8794a5b18cfa","notes":"This html node performs automated tasks as part of the workflow."},{"name":"(Fraud Check)","type":"n8n-nodes-base.httpRequest","notes":"Bitdefender","position":[4260,9163.397766717584],"parameters":{"url":"{{ $env.WEBHOOK_URL }}","method":"POST","options":{"redirect":{"redirect":{}},"response":{"response":{}},"allowUnauthorizedCerts":true},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"url","value":"={{ $('API Auth').item.json.LongURL.match(/^(?:https?:\\/\\/)?(?:[^@\\n]+@)?(?:www\\.)?([^:\\/\\n?]+)/im)[1] }}"}]},"headerParameters":{"parameters":[{"name":"Accept","value":"*/*"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"Referer","value":"{{ $env.WEBHOOK_URL }}"},{"name":"Origin","value":"{{ $env.WEBHOOK_URL }}"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Sec-Fetch-Dest","value":"empty"},{"name":"Sec-Fetch-Mode","value":"cors"},{"name":"Sec-Fetch-Site","value":"cross-site"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"notesInFlow":true,"typeVersion":4.1,"id":"2ed0ea2f-4ca8-4380-a311-c167e09f2ede"},{"name":"(Others)","type":"n8n-nodes-base.httpRequest","position":[4420,9163.397766717584],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"response":{"response":{}},"allowUnauthorizedCerts":true},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"},{"name":"Accept-Language","value":"en-US,en;q=0.5"},{"name":"Accept-Encoding","value":"gzip, deflate, br"},{"name":"Referer","value":"{{ $env.WEBHOOK_URL }}"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"},{"name":"DNT","value":"1"},{"name":"Connection","value":"keep-alive"},{"name":"Upgrade-Insecure-Requests","value":"1"},{"name":"Sec-Fetch-Dest","value":"document"},{"name":"Sec-Fetch-Mode","value":"navigate"},{"name":"Sec-Fetch-Site","value":"same-origin"},{"name":"Sec-Fetch-User","value":"?1"},{"name":"Sec-GPC","value":"1"},{"name":"Pragma","value":"no-cache"},{"name":"Cache-Control","value":"no-cache"},{"name":"TE","value":"trailers"}]}},"typeVersion":4.1,"id":"07414a3a-4418-438a-a8b7-ce1333e6c361","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"If2","type":"n8n-nodes-base.if","position":[4260,9520],"parameters":{"options":{"looseTypeValidation":true},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"or","conditions":[{"id":"c409582d-b8b3-409f-a7af-7dcccb6f6beb","operator":{"type":"number","operation":"lte"},"leftValue":"={{ ($json.result.match(/.*\\//)[0].replace('/','')).toDecimalNumber() }}","rightValue":"=5"},{"id":"f27aa777-2b4e-4bb9-8d0b-0de58283cc01","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $('If').item.json.rating }}","rightValue":"g"},{"id":"cbf7378d-c023-4de4-897d-e8c2e14bc08b","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $('If').item.json.rating }}","rightValue":"r"},{"id":"b240a351-6b68-4eac-a19e-383c44bbf721","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $json.safe }}","rightValue":""}]}},"typeVersion":2,"id":"1b1012ff-71e6-409c-9626-d2f5d5a8758b","notes":"This if node performs automated tasks as part of the workflow."},{"name":"set unsafe","type":"n8n-nodes-base.set","position":[4420,9540],"parameters":{"fields":{"values":[{"name":"Shortened URL","stringValue":"=Unsafe / Skipped getting {{ $item(\"0\").$node[\"HTML\"].json[\"result\"] }}"}]},"options":{}},"typeVersion":3.2,"id":"e3d600b2-e2e9-4d63-aacd-a412b3b2a71a","notes":"This set node performs automated tasks as part of the workflow."},{"name":"If3","type":"n8n-nodes-base.if","position":[3600,9380],"parameters":{"options":{},"conditions":{"options":{"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"4b55880c-53dc-47d3-acc5-ecf5166bcce5","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json['Scan LongURL'] }}","rightValue":"Yes,"}]}},"typeVersion":2,"id":"01cb2888-c977-404a-aedb-408d885b806f","notes":"This if node performs automated tasks as part of the workflow."},{"name":"PhishTank","type":"n8n-nodes-base.httpRequest","position":[4060,9520],"parameters":{"url":"{{ $env.BASE_URL }}","options":{"redirect":{"redirect":{}},"allowUnauthorizedCerts":true},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"User-Agent","value":"phishtank/anestooo"}]}},"typeVersion":4.1,"id":"cdb9858d-9bdd-4a72-b9ae-3a4ae4c65da6","notes":"This httpRequest node performs automated tasks as part of the workflow."},{"name":"IF GH invaild","type":"n8n-nodes-base.if","position":[3640,10100],"parameters":{"options":{"ignoreCase":true},"conditions":{"options":{"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"3c8cc92c-7232-4e30-b06b-3d8a57d80303","operator":{"type":"string","operation":"notExists","singleValue":true},"leftValue":"={{ $json.ogTitle }}","rightValue":""},{"id":"14329807-37fc-4265-beac-fff5bc4dda23","operator":{"type":"string","operation":"notExists","singleValue":true},"leftValue":"={{ $json.ogDescription }}","rightValue":""},{"id":"355ab988-c784-4fc3-8991-f5b0ab4b732a","operator":{"type":"string","operation":"notExists","singleValue":true},"leftValue":"={{ $json.ogImage }}","rightValue":""},{"id":"1f85c367-6270-42c2-b109-0a66ece133dc","operator":{"type":"string","operation":"contains"},"leftValue":"={{ $json.ogTitle + $json.ogDescription }}","rightValue":"Error"}]}},"typeVersion":2,"id":"e484ffbe-45d9-4dd1-a4f9-0a8d69dd76b8","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Method 4 - META","type":"n8n-nodes-base.set","position":[3840,10320],"parameters":{"fields":{"values":[{"name":"ogTitle","stringValue":"={{\n      // We used IFempty of title then use descraption, if the title giving no title output value then replace with descraption value, if no value for both then use empty value output.\n      // The domain name (Host)\n      // if the image url not found then use long URL host.\n \n($ifEmpty($json[\"title\"].replace('Error',$('API Auth').item.json[\"Brand Name\"].replaceAll('  ','')), ($(\"API Auth\").item.json[\"LongURL\"])\n        // This Regex to delete Any https:// or path from the url.\n        .match(/https?:\\/\\/[^\\/]+/)[0]\n        .replace(/https?:\\/\\//, \"\")\n      ))\n }}"},{"name":"ogDescription","stringValue":"={{ (($ifEmpty($json.description , $json[\"title\"])) || 'Visit Now') }}"},{"name":"ogImage","stringValue":"={{  // Constructing the base URL for the CDN\n  \"{{ $env.WEBHOOK_URL }}\" +\n  // Adding the title, URL encoded\n  ($ifEmpty($json[\"title\"].replace('Error',''), $('API Auth').item.json[\"Brand Name\"].replaceAll('  ','')).urlEncode() || \"\") +\n  \"/\" +\n  // Adding the description, URL encoded\n  ($ifEmpty($json[\"description\"].replace('No description',''), $json[\"title\"].replace('Error',$('API Auth').item.json[\"Brand Name\"].replaceAll('  ',''))).urlEncode() || \"\") +\n  \"/\" +\n  // Handling different OpenGraph Image Modes\n  (\n    $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'screenshot',\n      \"<SCR>\",\n      $if($('API Auth').item.json[\"OpenGraph Image Mode\"] === 'brand',\n        (\n          \"{{ $env.WEBHOOK_URL }}\" +\n          ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n            .replace(\"false\", \"white/\")\n            .replace(\"true\", \"dark/\") +\n          (\n            (`%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20`+ $(\"API Auth\").item.json[\"Brand Name\"].slice(0,18) + '%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C%20%E2%80%8C') ||\n            $json[\"title\"].toUpperCase() ||\n            $json[\"description\"].toUpperCase() ||\n            \"Short Link\"\n          ) + '.jpg'\n        ).urlEncode(),\n        $ifEmpty(\n          $json[\"image\"],\n          \"{{ $env.WEBHOOK_URL }}\" +\n            ($item(\"0\").$node[\"API Auth\"].json[\"Dark Mode ?\"] + \"\")\n              .replace(\"false\", \"white/\")\n              .replace(\"true\", \"dark/\") +\n            \"Default.jpg\"\n        ).urlEncode()\n      )\n    )\n  ) +\n  \"/og.png\"\n}}"},{"name":"Favicon","stringValue":"={{ $ifEmpty($json[\"favicon\"],\n(\n// Get the Favicon url, if not available then generate api request to get it with:\n\"{{ $env.WEBHOOK_URL }}\" +\n// Get the image failed to export how from it if not found then use LongURL.\n$ifEmpty($('API Auth').item.json[\"LongURL\"],\n''\n)\n// This Regex to delete Any https:// or path from the url.\n.match(/https?:\\/\\/[^\\/]+/)[0]\n.replace(/https?:\\/\\//, \"\") +\n// This Parameter to resize the favicon into 32pixels.\n\"?s=32\"\n)) }}"}]},"include":"none","options":{}},"typeVersion":3.2,"id":"65830400-7c40-4572-835d-4f87e1666abb","notes":"This set node performs automated tasks as part of the workflow."},{"name":"IF dub invaild","type":"n8n-nodes-base.if","position":[3380,10300],"parameters":{"options":{"ignoreCase":true},"conditions":{"options":{"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"3c8cc92c-7232-4e30-b06b-3d8a57d80303","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.title }}","rightValue":"No title"},{"id":"14329807-37fc-4265-beac-fff5bc4dda23","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.description }}","rightValue":"No description"},{"id":"355ab988-c784-4fc3-8991-f5b0ab4b732a","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.image }}","rightValue":"No image"},{"id":"1f85c367-6270-42c2-b109-0a66ece133dc","operator":{"type":"string","operation":"contains"},"leftValue":"={{ $json.title + $json.description }}","rightValue":"Error"}]}},"typeVersion":2,"id":"d832309a-b022-440d-a1ab-9c6f646b70f3","notes":"This if node performs automated tasks as part of the workflow."},{"name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[4580,9060],"parameters":{"width":1000.9922558475889,"height":700.251847890049,"content":"\n\n\n\n‌\n‌\n‌\n‌\n‌\n# 💡FYI:-\n- ### **This workflow can be for any URL Shortener by just changing the API Services for the shortener SaaS.**\n- ### **Do not use it for spam purposes as the used APIs is mostly workaround methods and not for \"Big Use Cases\".**\n- ### **Breaking the APIs will force me to not share them free. and yes this workflow not for productions.**\n- ### **Support 1:1 not included with this workflow. post anything you have** [here]({{ $env.WEBHOOK_URL }} and mention my account @Nskha.\n- ### **Follow my new templates updates** [on telegram]({{ $env.WEBHOOK_URL }}\n\n‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌[![N8N Creator Profile - Nskha]({{ $env.WEBHOOK_URL }}]({{ $env.WEBHOOK_URL }}"},"typeVersion":1,"id":"16146f7f-3d79-4ce3-9029-7e92ffd0a2e8","notes":"This stickyNote node performs automated tasks as part of the workflow."}],"active":"false","settings":{"timezone":"UTC","callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"executionOrder":"v1","executionTimeout":3600,"saveManualExecutions":true,"saveExecutionProgress":true,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"staticData":"","connections":{"Get Headers":{"main":[[],[],[],[],[],[],[]]},"OpenGraph API":{"main":[[],[],[],[],[],[],[]]},"Meta tags Scraper - dub.sh":{"main":[[],[],[],[],[],[],[]]},"CREATE":{"main":[[],[],[],[],[],[],[]]},"UPDATE":{"main":[[],[],[],[],[],[],[]]},"Download final OG":{"main":[[],[],[],[],[],[],[]]},"Download Favicon":{"main":[[],[],[],[],[],[],[]]},"Method 1 - SCR":{"main":[[],[],[],[],[],[],[]]},"Method 2 - SCR":{"main":[[],[],[],[],[],[],[]]},"Respond to Webhook":{"main":[[],[],[],[],[],[],[]]},"Scan URL (Community)":{"main":[[],[],[],[],[],[],[]]},"Check Reviews (Community)":{"main":[[],[],[],[],[],[],[]]},"(Fraud Check)":{"main":[[],[],[],[],[],[],[]]},"(Others)":{"main":[[],[],[],[],[],[],[]]},"PhishTank":{"main":[[],[],[],[],[],[],[]]}},"description":"Automated workflow: [n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. This workflow processes data and performs automated tasks.","notes":"Excellent quality workflow: [n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}