{
  "name": "\ud83e\udd16 Gemini \u00d7 \u81ea\u52d5\u30d6\u30ed\u30b0\u751f\u6210\u30d5\u30ed\u30fc",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "id": "trigger-schedule",
      "name": "\u6bce\u65e5\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u5b9f\u884c",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        240,
        300
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "url": "https://news.google.com/rss/search?q=AI+\u81ea\u52d5\u5316+DX&hl=ja&gl=JP&ceid=JP:ja",
        "options": {}
      },
      "id": "rss-google-news",
      "name": "Google News\u304b\u3089\u30c8\u30ec\u30f3\u30c9\u53ce\u96c6",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        460,
        300
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "operation": "limit",
        "maxItems": 3
      },
      "id": "limit-articles",
      "name": "\u8a18\u4e8b\u30923\u4ef6\u306b\u7d5e\u308b",
      "type": "n8n-nodes-base.limit",
      "position": [
        680,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "key",
              "value": "={{ $env.GEMINI_API_KEY }}"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"parts\": [\n        {\n          \"text\": \"\u3042\u306a\u305f\u306f\u65e5\u672c\u8a9e\u3067\u66f8\u304f\u512a\u308c\u305f\u30d6\u30ed\u30b0\u30e9\u30a4\u30bf\u30fc\u3067\u3059\u3002\\n\\n\u4ee5\u4e0b\u306e\u30cb\u30e5\u30fc\u30b9\u8a18\u4e8b\u3092\u5143\u306b\u3001\u65e5\u672c\u306e\u30d3\u30b8\u30cd\u30b9\u30d1\u30fc\u30bd\u30f3\u5411\u3051\u306e\u6709\u76ca\u306a\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u65e5\u672c\u8a9e\u3067\u66f8\u3044\u3066\u304f\u3060\u3055\u3044\u3002\\n\\n\u30bf\u30a4\u30c8\u30eb: {{ $json.title }}\\n\u5185\u5bb9: {{ $json.content }}\\n\\n\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1a\\n---\\n\u3010\u30bf\u30a4\u30c8\u30eb\u3011\uff08\u9b45\u529b\u7684\u306a\u30bf\u30a4\u30c8\u30eb\uff09\\n\u3010\u5c0e\u5165\u3011\uff08150\u5b57\u7a0b\u5ea6\u306e\u30ea\u30fc\u30c9\u6587\uff09\\n\u3010\u672c\u6587\u3011\uff08500\u5b57\u7a0b\u5ea6\u3001\u7b87\u6761\u66f8\u304d\u3084\u6539\u884c\u3092\u4f7f\u3044\u8aad\u307f\u3084\u3059\u304f\uff09\\n\u3010\u307e\u3068\u3081\u3011\uff08100\u5b57\u7a0b\u5ea6\u306e\u307e\u3068\u3081\u3068\u884c\u52d5\u63d0\u6848\uff09\\n\u3010\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0\u3011\uff085\u500b\u3001SNS\u6295\u7a3f\u7528\uff09\\n---\"\n        }\n      ]\n    }\n  ],\n  \"generationConfig\": {\n    \"temperature\": 0.7,\n    \"maxOutputTokens\": 1024\n  }\n}",
        "options": {}
      },
      "id": "gemini-generate",
      "name": "Gemini Flash \u3067\u8a18\u4e8b\u751f\u6210",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        900,
        300
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "jsCode": "// Gemini\u306e\u5fdc\u7b54\u304b\u3089\u30c6\u30ad\u30b9\u30c8\u3092\u62bd\u51fa\nconst response = $input.item.json;\nconst text = response.candidates?.[0]?.content?.parts?.[0]?.text || '\u30a8\u30e9\u30fc: \u30c6\u30ad\u30b9\u30c8\u306a\u3057';\n\n// \u30bf\u30a4\u30c8\u30eb\u3068\u672c\u6587\u3092\u5206\u96e2\nconst titleMatch = text.match(/\u3010\u30bf\u30a4\u30c8\u30eb\u3011(.+?)\\n/);\nconst bodyMatch = text.match(/\u3010\u672c\u6587\u3011([\\s\\S]+?)\u3010\u307e\u3068\u3081\u3011/);\nconst summaryMatch = text.match(/\u3010\u307e\u3068\u3081\u3011([\\s\\S]+?)\u3010\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0\u3011/);\nconst tagsMatch = text.match(/\u3010\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0\u3011([\\s\\S]+)/);\n\nreturn [{\n  json: {\n    title: titleMatch ? titleMatch[1].trim() : '\u8a18\u4e8b\u30bf\u30a4\u30c8\u30eb',\n    content: bodyMatch ? bodyMatch[1].trim() : text,\n    summary: summaryMatch ? summaryMatch[1].trim() : '',\n    hashtags: tagsMatch ? tagsMatch[1].trim() : '',\n    fullText: text,\n    generatedAt: new Date().toISOString()\n  }\n}];"
      },
      "id": "extract-text",
      "name": "\u30c6\u30ad\u30b9\u30c8\u6574\u5f62",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        300
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "operation": "create",
        "postType": "post",
        "title": "={{ $json.title }}",
        "content": "={{ $json.content + '\\n\\n' + $json.summary }}",
        "status": "draft",
        "additionalFields": {}
      },
      "id": "wordpress-post",
      "name": "WordPress\u306b\u4e0b\u66f8\u304d\u6295\u7a3f",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        1340,
        300
      ],
      "typeVersion": 1,
      "notes": "WordPress\u306e\u63a5\u7d9a\u8a2d\u5b9a\u304c\u5fc5\u8981: Settings > Credentials > WordPress"
    }
  ],
  "connections": {
    "\u6bce\u65e5\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u5b9f\u884c": {
      "main": [
        [
          {
            "node": "Google News\u304b\u3089\u30c8\u30ec\u30f3\u30c9\u53ce\u96c6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google News\u304b\u3089\u30c8\u30ec\u30f3\u30c9\u53ce\u96c6": {
      "main": [
        [
          {
            "node": "\u8a18\u4e8b\u30923\u4ef6\u306b\u7d5e\u308b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u8a18\u4e8b\u30923\u4ef6\u306b\u7d5e\u308b": {
      "main": [
        [
          {
            "node": "Gemini Flash \u3067\u8a18\u4e8b\u751f\u6210",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Flash \u3067\u8a18\u4e8b\u751f\u6210": {
      "main": [
        [
          {
            "node": "\u30c6\u30ad\u30b9\u30c8\u6574\u5f62",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u30c6\u30ad\u30b9\u30c8\u6574\u5f62": {
      "main": [
        [
          {
            "node": "WordPress\u306b\u4e0b\u66f8\u304d\u6295\u7a3f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "Gemini"
    },
    {
      "name": "\u81ea\u52d5\u30d6\u30ed\u30b0"
    },
    {
      "name": "AI"
    }
  ],
  "meta": {
    "description": "Google News\u304b\u3089\u30c8\u30ec\u30f3\u30c9\u3092RSS\u53d6\u5f97\u3057\u3001Gemini 1.5 Flash\u3067\u8a18\u4e8b\u3092\u81ea\u52d5\u751f\u6210\u3057\u3066WordPress\u306b\u4e0b\u66f8\u304d\u6295\u7a3f\u3059\u308b\u30d5\u30ed\u30fc\u3002GEMINI_API_KEY\u3092n8n\u306e\u74b0\u5883\u5909\u6570\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
  }
}