Cron
Google'da Günlük 10 Site Araması
Description
Cron tetikleyicisiyle günde 10 kez Google'da belirttiğiniz web sitesini arayan ve sonuçları loglayan otomasyon.
Setup Guide
1. n8n'de yeni bir workflow oluşturun.
2. **Cron** düğmesini ekleyin ve **Every 2 hours 24 minutes** (her 144 dakikada bir) çalışacak şekilde ayarlayın (günde 10 kez).
3. **HTTP Request** düğmesini ekleyin, Method: GET, URL: `https://www.google.com/search?q=site:{{ $json.siteUrl }}`.
4. **Set** düğmesi ekleyin, bir `siteUrl` alanı oluşturun ve değer olarak aramak istediğiniz tam alan adını girin (örnek: `example.com`).
5. **Function** düğmesini ekleyin, yanıtı kontrol edip `statusCode` 200 değilse hata fırlatın.
6. **Error Trigger** düğmesini ekleyin, hataları bir Slack/Telegram kanalına ya da e‑posta ile bildirecek şekilde yapılandırın (isteğe bağlı).
7. Düğümleri aşağıdaki JSON'a göre bağlayın: Cron → Set → HTTP Request → Function → (Opsiyonel) Error Trigger.
8. Workflow'u **Active** konumuna getirin.
9. Gerekirse Google'ın bot tespit önlemlerini aşmak için bir proxy veya `User-Agent` başlığı ekleyin (HTTP Request düğmesinde **Headers** sekmesi).
10. Çalışmayı doğrulamak için workflow'u manuel olarak çalıştırın ve **Execution** sekmesinden logları inceleyin.
2. **Cron** düğmesini ekleyin ve **Every 2 hours 24 minutes** (her 144 dakikada bir) çalışacak şekilde ayarlayın (günde 10 kez).
3. **HTTP Request** düğmesini ekleyin, Method: GET, URL: `https://www.google.com/search?q=site:{{ $json.siteUrl }}`.
4. **Set** düğmesi ekleyin, bir `siteUrl` alanı oluşturun ve değer olarak aramak istediğiniz tam alan adını girin (örnek: `example.com`).
5. **Function** düğmesini ekleyin, yanıtı kontrol edip `statusCode` 200 değilse hata fırlatın.
6. **Error Trigger** düğmesini ekleyin, hataları bir Slack/Telegram kanalına ya da e‑posta ile bildirecek şekilde yapılandırın (isteğe bağlı).
7. Düğümleri aşağıdaki JSON'a göre bağlayın: Cron → Set → HTTP Request → Function → (Opsiyonel) Error Trigger.
8. Workflow'u **Active** konumuna getirin.
9. Gerekirse Google'ın bot tespit önlemlerini aşmak için bir proxy veya `User-Agent` başlığı ekleyin (HTTP Request düğmesinde **Headers** sekmesi).
10. Çalışmayı doğrulamak için workflow'u manuel olarak çalıştırın ve **Execution** sekmesinden logları inceleyin.
Workflow Preview
JSON Code
automation.json
{
"nodes": [
{
"parameters": {
"cronExpression": "0 *\/2 * * *",
"timezone": "Etc\/UTC",
"offset": 24
},
"name": "Cron",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [
250,
300
],
"trigger": true
},
{
"parameters": {
"values": {
"string": [
{
"name": "siteUrl",
"value": "example.com"
}
]
},
"options": []
},
"name": "Set Site URL",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
450,
300
]
},
{
"parameters": {
"url": "https:\/\/www.google.com\/search?q=site:{{$json[\"siteUrl\"]}}",
"options": {
"headers": {
"User-Agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/124.0.0.0 Safari\/537.36"
},
"followRedirect": true
},
"responseFormat": "string"
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
650,
300
]
},
{
"parameters": {
"functionCode": "if (items[0].json.statusCode && items[0].json.statusCode !== 200) {\n throw new Error('Google request failed with status ' + items[0].json.statusCode);\n}\nreturn items;"
},
"name": "Validate Response",
"type": "n8n-nodes-base.function",
"typeVersion": 2,
"position": [
850,
300
]
},
{
"parameters": {
"errorWorkflowId": "",
"errorWorkflowExecutionMode": "manual"
},
"name": "Error Trigger",
"type": "n8n-nodes-base.errorTrigger",
"typeVersion": 1,
"position": [
1050,
300
]
}
],
"connections": {
"Cron": {
"main": [
[
{
"node": "Set Site URL",
"type": "main",
"index": 0
}
]
]
},
"Set Site URL": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Validate Response",
"type": "main",
"index": 0
}
]
]
},
"Validate Response": {
"main": [
[
{
"node": "Error Trigger",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": [],
"id": "1"
}