Diese Seite ändert sich noch. Komm also wieder und schaue was es neues gibt!

Copy+Paste diesen Code in n8n:

{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
120,
540
]
},
{
"parameters": {
"resource": "video",
"limit": 1,
"filters": {
"channelId": "UCn3qSK-GiFmks7IH2Amkrsw",
"publishedAfter": "={{$node[\"Function1\"].json[\"date_today\"]}}"
},
"options": {}
},
"name": "YouTube",
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
480,
400
],
"credentials": {
"youTubeOAuth2Api": {
"id": "25",
"name": "Alex Hammerschmied - YT"
}
}
},
{
"parameters": {
"functionCode": "var d = new Date();\nd.setDate(d.getDate() - 7);\nd.setHours(0,0,0,0);\nconst [dShort] = d.toISOString().split('T');\n\nitems[0].json.date_today = d;\nitems[0].json.date_short = dShort;\n\nreturn items;"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"position": [
300,
400
],
"typeVersion": 1,
"notesInFlow": true,
"notes": "Calculate dates"
},
{
"parameters": {
"authentication": "basicAuth",
"requestMethod": "POST",
"url": "https://your-mautic-domain.io/api/emails/new",
"options": {},
"bodyParametersUi": {
"parameter": [
{
"name": "name",
"value": "=YT-Newsletter-{{$node[\"Function1\"].json[\"date_short\"]}}"
},
{
"name": "subject",
"value": "={{$node[\"YouTube\"].json[\"snippet\"][\"title\"]}}"
},
{
"name": "isPublished",
"value": "1"
},
{
"name": "template",
"value": "hartmutnewsletter"
},
{
"name": "customHtml",
"value": "=<!doctype html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\">\n <head>\n <title>\n </title>\n <!--[if !mso]><!-->\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <!--<![endif]-->\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <style type=\"text/css\">\n #outlook a {\n padding:0;\n }\n body {\n margin:0;\n padding:0;\n -webkit-text-size-adjust:100%;\n -ms-text-size-adjust:100%;\n }\n table, td {\n border-collapse:collapse;\n mso-table-lspace:0pt;\n mso-table-rspace:0pt;\n }\n img {\n border:0;\n height:auto;\n line-height:100%;\n outline:none;\n text-decoration:none;\n -ms-interpolation-mode:bicubic;\n }\n p {\n display:block;\n margin:13px 0;\n }\n </style>\n <!--[if mso]>\n<noscript>\n<xml>\n<o:OfficeDocumentSettings>\n<o:AllowPNG/>\n<o:PixelsPerInch>96</o:PixelsPerInch>\n</o:OfficeDocumentSettings>\n</xml>\n</noscript>\n<![endif]-->\n <!--[if lte mso 11]>\n<style type=\"text/css\">\n.mj-outlook-group-fix { width:100% !important; }\n</style>\n<![endif]-->\n <!--[if !mso]><!-->\n <link href=\"https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700\" rel=\"stylesheet\" type=\"text/css\">\n <style type=\"text/css\">\n @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);\n </style>\n <!--<![endif]-->\n <style type=\"text/css\">\n @media only screen and (min-width:480px) {\n .mj-column-per-100 {\n width:100% !important;\n max-width: 100%;\n }\n }\n </style>\n <style media=\"screen and (min-width:480px)\">\n .moz-text-html .mj-column-per-100 {\n width:100% !important;\n max-width: 100%;\n }\n </style>\n <style type=\"text/css\">\n @media only screen and (max-width:480px) {\n table.mj-full-width-mobile {\n width: 100% !important;\n }\n td.mj-full-width-mobile {\n width: auto !important;\n }\n }\n </style>\n <style type=\"text/css\">\n </style>\n </head>\n <body style=\"word-spacing:normal;\">\n <div\n style=\"\"\n >\n <!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" bgcolor=\"#ffffff\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n <div style=\"background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;\">\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"\n >\n <tbody>\n <tr>\n <td\n style=\"direction:ltr;font-size:0px;padding:20px 0;padding-top:0;text-align:center;\"\n >\n <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n <div\n class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n >\n <tbody>\n <tr>\n <td\n align=\"center\" style=\"background:#0b0b0b;font-size:0px;padding:10px 25px;padding-top:0;word-break:break-word;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:collapse;border-spacing:0px;\"\n >\n <tbody>\n <tr>\n <td style=\"width:550px;\">\n <a\n href=\"https://hartmut.io\" target=\"_blank\"\n >\n <img\n alt=\"hartmut.io Logo\" height=\"auto\" src=\"https://email.hartmut.io/media/images/email-header.png\" style=\"border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;\" width=\"550\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td\n align=\"left\" style=\"font-size:0px;padding:10px 25px;padding-top:0;padding-bottom:0px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;\"\n >\n <p>{{$node[\"YouTube\"].json[\"snippet\"][\"title\"]}}\n </p>\n </div>\n </td>\n </tr>\n <tr>\n <td\n align=\"left\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;padding-bottom:0px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:13px;line-height:1.5;text-align:left;color:#000000;\"\n >\n <p>Hi {contactfield=firstname},\n </p>\n <p>{{$node[\"YouTube\"].json[\"snippet\"][\"description\"]}}\n </p>\n <p>OK. Ich will dich gar nicht mit allzuviel Text langweilen.\n </p>\n <p>🎥 👉 \n <a href=\"https://youtu.be/{{$node[\"YouTube\"].json[\"id\"][\"videoId\"]}}\">Hier gehts direkt zum Video</a>\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" bgcolor=\"#ffffff\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n <div style=\"background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;\">\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"\n >\n <tbody>\n <tr>\n <td\n style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0;padding-top:20px;text-align:center;\"\n >\n <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n <div\n class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n >\n <tbody>\n <tr>\n <td\n align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-top:0;padding-right:0px;padding-bottom:0px;padding-left:0px;word-break:break-word;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:collapse;border-spacing:0px;\"\n >\n <tbody>\n <tr>\n <td style=\"width:550px;\">\n <a\n href=\"https://youtu.be/{{$node[\"YouTube\"].json[\"id\"][\"videoId\"]}}\" target=\"_blank\" title=\"zum Video\"\n >\n <img\n alt=\"videoThumbnail\" height=\"auto\" src=\"{{$node[\"YouTube\"].json[\"snippet\"][\"thumbnails\"][\"high\"][\"url\"]}}\" style=\"border:none;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;\" title=\"zum Video\" width=\"550\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td\n align=\"center\" vertical-align=\"middle\" style=\"font-size:0px;padding:15px 30px;padding-top:25px;word-break:break-word;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:separate;line-height:100%;\"\n >\n <tbody>\n <tr>\n <td\n align=\"center\" bgcolor=\"#f9b818\" role=\"presentation\" style=\"border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#f9b818;\" valign=\"middle\"\n >\n <a\n href=\"https://youtu.be/{{$node[\"YouTube\"].json[\"id\"][\"videoId\"]}}\" style=\"display:inline-block;background:#f9b818;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:13px;font-weight:700;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;\" target=\"_blank\"\n >\n ZUM NEUEN VIDEO\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td\n align=\"left\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;padding-bottom:0px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:11px;line-height:1.5;text-align:left;color:#000000;\"\n >\n <p>Es ist eine RIESENHILFE für mich und den Channel, wenn du dir das Video ansiehst und einen \"Daumen hoch\" da lässt. Und wenn du ein Kommentar hinterlassen kannst, ist das nochmal ein Turbobooster für den Algorithmus in Youtube. Mein Channel ist so klein, dass Youtube noch gar nicht bemerkt hat, dass Mautic in vielen Bereichen besser ist als andere Marketing Automation Programme. Mit deiner Hilfe können wir den Channel und die Inhalte an noch mehr Leute bringen und bekannter machen. Das tut uns und der ganzen Mautic Community gut. Danke dir schonmal im Voraus :)\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" bgcolor=\"#ffffff\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n <div style=\"background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;\">\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"\n >\n <tbody>\n <tr>\n <td\n style=\"direction:ltr;font-size:0px;padding:20px 0;text-align:center;\"\n >\n <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n <div\n class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n >\n <tbody>\n <tr>\n <td\n align=\"left\" style=\"font-size:0px;padding:10px 25px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1.5em;text-align:left;color:#000000;\"\n >\n <p>Danke für dein Interesse und dass du Teil unserer wunderbaren Community bist 🙌\n </p>\n <p>{signature}\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" role=\"presentation\" style=\"width:600px;\" width=\"600\" bgcolor=\"#1e1f27\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]-->\n <div style=\"background:#1e1f27;background-color:#1e1f27;margin:0px auto;max-width:600px;\">\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#1e1f27;background-color:#1e1f27;width:100%;\"\n >\n <tbody>\n <tr>\n <td\n style=\"direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0px;padding-top:0;text-align:center;\"\n >\n <!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:top;width:600px;\" ><![endif]-->\n <div\n class=\"mj-column-per-100 mj-outlook-group-fix\" style=\"font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;\"\n >\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:top;\" width=\"100%\"\n >\n <tbody>\n <tr>\n <td\n align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-top:20px;word-break:break-word;\"\n >\n <!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" ><tr><td><![endif]-->\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\"\n >\n <tbody>\n <tr\n >\n <td style=\"padding:4px;vertical-align:middle;\">\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#EB3323;border-radius:3px;width:35px;\"\n >\n <tbody>\n <tr>\n <td style=\"font-size:0;height:35px;vertical-align:middle;width:35px;\">\n <a href=\"https://www.youtube.com/channel/UCn3qSK-GiFmks7IH2Amkrsw\" target=\"_blank\">\n <img\n height=\"35\" src=\"https://www.mailjet.com/images/theme/v1/icons/ico-social/youtube.png\" style=\"border-radius:3px;display:block;\" width=\"35\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso | IE]></td><td><![endif]-->\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\"\n >\n <tbody>\n <tr\n >\n <td style=\"padding:4px;vertical-align:middle;\">\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#55acee;border-radius:3px;width:35px;\"\n >\n <tbody>\n <tr>\n <td style=\"font-size:0;height:35px;vertical-align:middle;width:35px;\">\n <a href=\"https://twitter.com/intent/tweet?url=https://twitter.com/A_AutomateThis\" target=\"_blank\">\n <img\n height=\"35\" src=\"https://www.mailjet.com/images/theme/v1/icons/ico-social/twitter.png\" style=\"border-radius:3px;display:block;\" width=\"35\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso | IE]></td><td><![endif]-->\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\"\n >\n <tbody>\n <tr\n >\n <td style=\"padding:4px;vertical-align:middle;\">\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#404040;border-radius:3px;width:35px;\"\n >\n <tbody>\n <tr>\n <td style=\"font-size:0;height:35px;vertical-align:middle;width:35px;\">\n <a href=\"https://www.tiktok.com/@automate.this\" target=\"_blank\">\n <img\n height=\"35\" src=\"https://email.hartmut.io/media/images/tiktok.png\" style=\"border-radius:3px;display:block;\" width=\"35\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso | IE]></td><td><![endif]-->\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\"\n >\n <tbody>\n <tr\n >\n <td style=\"padding:4px;vertical-align:middle;\">\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#3b5998;border-radius:3px;width:35px;\"\n >\n <tbody>\n <tr>\n <td style=\"font-size:0;height:35px;vertical-align:middle;width:35px;\">\n <a href=\"https://www.facebook.com/sharer/sharer.php?u=https://www.facebook.com/hartmut.io\" target=\"_blank\">\n <img\n height=\"35\" src=\"https://www.mailjet.com/images/theme/v1/icons/ico-social/facebook.png\" style=\"border-radius:3px;display:block;\" width=\"35\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso | IE]></td><td><![endif]-->\n <table\n align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"float:none;display:inline-table;\"\n >\n <tbody>\n <tr\n >\n <td style=\"padding:4px;vertical-align:middle;\">\n <table\n border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#0077b5;border-radius:3px;width:35px;\"\n >\n <tbody>\n <tr>\n <td style=\"font-size:0;height:35px;vertical-align:middle;width:35px;\">\n <a href=\"https://www.linkedin.com/shareArticle?mini=true&url=https://www.linkedin.com/company/hartmutrocks&title=&summary=&source=\" target=\"_blank\">\n <img\n height=\"35\" src=\"https://www.mailjet.com/images/theme/v1/icons/ico-social/linkedin.png\" style=\"border-radius:3px;display:block;\" width=\"35\"\n />\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </td>\n </tr>\n <tr>\n <td\n align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:13px;line-height:1.2;text-align:center;color:#000000;\"\n >\n <p>\n <strong><span style=\"color:white\">Kraft Fabrik Media Ltd.</span></strong>\n </p>\n <p>\n <span style=\"color:white\">Reg.Nr.: HE388979,</span>\n <br>\n <span style=\"color:white\">8560 Peyia, Kountourioti 6 Building 1, Cyprus</span>\n </p>\n </div>\n </td>\n </tr>\n <tr>\n <td\n align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-top:0px;word-break:break-word;\"\n >\n <div\n style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif;font-size:10px;line-height:1.2;text-align:center;color:#000000;\"\n >\n <p>\n <span style=\"color:white\">{unsubscribe_text}</span>\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <!--[if mso | IE]></td></tr></table><![endif]-->\n </div>\n </body>\n</html>"
},
{
"name": "emailType",
"value": "list"
},
{
"name": "lists",
"value": "={{ {lists:49} }}"
},
{
"name": "publishUp",
"value": "={{$node[\"Function\"].json[\"ytPublishDate\"]}}"
},
{
"name": "publishDown",
"value": "={{$node[\"Function\"].json[\"ytUnPublishDate\"]}}"
}
]
}
},
"name": "New Email",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
840,
400
],
"credentials": {
"httpBasicAuth": {
"id": "44",
"name": "Mautic CURL BasicAuth"
}
}
},
{
"parameters": {
"functionCode": "const pub_date = $node[\"YouTube\"].json[\"snippet\"][\"publishedAt\"];\nconst date1 = pub_date.replace(/.\\d+Z$/g, \"Z\").replace(\"Z\", \"\").replace(\"T\", \" \");\n\nfunction addHours(numOfHours, date = new Date()) {\n date.setTime(date.getTime() + numOfHours * 60 * 60 * 1000);\n\n return date;\n}\n\nconst date = new Date($node[\"YouTube\"].json[\"snippet\"][\"publishedAt\"]);\nconst date2 = addHours(12, date);\nconst date3 = date2.toISOString().replace(/.\\d+Z$/g, \"Z\").replace(\"Z\", \"\").replace(\"T\", \" \");\n\n\nitems[0].json.ytPublishDate = date1;\nitems[0].json.ytUnPublishDate = date3;\n\nreturn items;"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"position": [
660,
400
],
"typeVersion": 1
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 10
}
]
}
},
"name": "Cron",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [
120,
400
]
}
],
"connections": {
"YouTube": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function1": {
"main": [
[
{
"node": "YouTube",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "New Email",
"type": "main",
"index": 0
}
]
]
},
"Cron": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
}
}
}