n8n-nodes-seo-scanner 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -0
- package/dist/SeoScanner.node.d.ts +40 -0
- package/dist/SeoScanner.node.js +2435 -0
- package/dist/SeoScanner.node.js.map +1 -0
- package/dist/nodes/SeoScanner/SeoScanner.node.js +2435 -0
- package/dist/nodes/SeoScanner/SeoScanner.node.json +9 -0
- package/dist/nodes/SeoScanner/reportTemplate.js +158 -0
- package/dist/nodes/SeoScanner/seoScanner.svg +6 -0
- package/dist/reportTemplate.d.ts +1 -0
- package/dist/reportTemplate.js +158 -0
- package/dist/reportTemplate.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# n8n-nodes-seo-scanner
|
|
2
|
+
|
|
3
|
+
Nodo personalizado de n8n para **escaneo SEO técnico** de una página web.
|
|
4
|
+
|
|
5
|
+
## Qué hace
|
|
6
|
+
|
|
7
|
+
- **Una URL**: Analiza la página indicada y devuelve un informe técnico SEO.
|
|
8
|
+
- **Opción "Escanear enlaces internos"**: Además de la página principal, analiza hasta N enlaces internos (mismo dominio) encontrados en la página, con un **máximo configurable** (1–50) para no alargar demasiado el escaneo.
|
|
9
|
+
|
|
10
|
+
## Comprobaciones SEO incluidas
|
|
11
|
+
|
|
12
|
+
- **URL**: HTTPS, código de respuesta
|
|
13
|
+
- **Título**: presencia, longitud (30–60 caracteres), avisos
|
|
14
|
+
- **Meta description**: presencia, longitud (120–160 caracteres)
|
|
15
|
+
- **Meta viewport**: correcta para móvil
|
|
16
|
+
- **Meta robots**: contenido y aviso si hay noindex
|
|
17
|
+
- **Canonical**: presencia y si apunta a la propia URL
|
|
18
|
+
- **H1**: cantidad (recomendado 1), textos
|
|
19
|
+
- **Estructura de headings**: H2, H3, etc.
|
|
20
|
+
- **Imágenes**: total, con/sin `alt`, lista de las que faltan
|
|
21
|
+
- **Enlaces**: internos vs externos, lista de URLs internas
|
|
22
|
+
- **Open Graph**: og:title, og:description, og:image
|
|
23
|
+
- **JSON-LD**: número de scripts de datos estructurados
|
|
24
|
+
- **Atributo lang** en `<html>`
|
|
25
|
+
- **Charset** y **favicon**
|
|
26
|
+
- **Palabras** (aprox.) en el cuerpo
|
|
27
|
+
- **Puntuación 0–100** y listas de **issues**, **warnings** y **checks pasados**
|
|
28
|
+
|
|
29
|
+
## Instalación
|
|
30
|
+
|
|
31
|
+
1. En la carpeta del nodo:
|
|
32
|
+
```bash
|
|
33
|
+
npm install
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Configura n8n para cargar el nodo (por ejemplo con variable de entorno):
|
|
38
|
+
```bash
|
|
39
|
+
N8N_CUSTOM_EXTENSIONS="C:\Users\tu-usuario\.n8n\custom\n8n-nodes-seo-scanner"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. Reinicia n8n. El nodo **SEO Scanner** aparecerá en la categoría Analytics / Marketing.
|
|
43
|
+
|
|
44
|
+
## Uso
|
|
45
|
+
|
|
46
|
+
- **URL de la página**: obligatoria; debe ser una URL absoluta (p. ej. `https://example.com/pagina`).
|
|
47
|
+
- **Escanear enlaces internos**: activar si quieres que además se analicen enlaces internos de esa página.
|
|
48
|
+
- **Máximo de URLs internas**: solo si lo anterior está activado; entre 1 y 50 (por defecto 10).
|
|
49
|
+
- **Timeout por página**: segundos de espera por cada página (5–60).
|
|
50
|
+
|
|
51
|
+
## Salida
|
|
52
|
+
|
|
53
|
+
- **mainPage**: objeto con todo el análisis de la URL principal.
|
|
54
|
+
- Si escaneas enlaces internos: **internalPages** (array de análisis por URL), **internalScanSummary** (resumen: total escaneadas, páginas con errores, puntuación min/max/media) y **mainPageScore** / **averageScoreInternal**.
|
|
55
|
+
|
|
56
|
+
## Informe HTML (dashboard)
|
|
57
|
+
|
|
58
|
+
Si activas **Generar informe HTML**, el nodo devuelve (igual que el [nodo HTML de n8n](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.html/)):
|
|
59
|
+
|
|
60
|
+
- **`html`**: HTML completo del informe (para usar en Respond to Webhook).
|
|
61
|
+
- **`reportHtml`**: el mismo HTML.
|
|
62
|
+
|
|
63
|
+
### Cómo ver el informe en el navegador (recomendado)
|
|
64
|
+
|
|
65
|
+
1. **Webhook + Respond to Webhook** (igual que [servir HTML con webhooks en n8n](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/)):
|
|
66
|
+
- **Webhook** (trigger) → **SEO Scanner** (con “Generar informe HTML” activado) → **Respond to Webhook**.
|
|
67
|
+
- En Respond to Webhook: **Respond With** = **Text**, **Response Body** = `{{ $json.html }}`.
|
|
68
|
+
- En el Webhook: “Respond to Using” = Respond to Webhook.
|
|
69
|
+
- Activa el workflow y abre la URL del webhook en el navegador (GET). Verás el dashboard.
|
|
70
|
+
|
|
71
|
+
2. **Si ves pantalla en blanco** al abrir esa URL (desde n8n 1.103 el HTML se sirve dentro de un iframe con sandbox):
|
|
72
|
+
- **Self‑hosted**: añade la variable de entorno `N8N_INSECURE_DISABLE_WEBHOOK_IFRAME_SANDBOX=true` y reinicia n8n ([referencia](https://github.com/n8n-io/n8n/issues/17962)).
|
|
73
|
+
- **Alternativa**: guarda el informe en un archivo y ábrelo: copia `{{ $json.html }}` o `{{ $json.reportHtml }}`, pégalo en un editor, guarda como `informe.html` (UTF-8) y ábrelo en Chrome/Edge/Firefox.
|
|
74
|
+
|
|
75
|
+
## Requisitos
|
|
76
|
+
|
|
77
|
+
- Node.js 18+ (usa `fetch` nativo).
|
|
78
|
+
- Dependencia: `cheerio` para parsear HTML.
|
|
79
|
+
|
|
80
|
+
## Licencia
|
|
81
|
+
|
|
82
|
+
MIT
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export interface CrawlExtras {
|
|
3
|
+
ipv6: string | null;
|
|
4
|
+
dnsA: string[];
|
|
5
|
+
dnsCname: string[];
|
|
6
|
+
dnsMx: string[];
|
|
7
|
+
cdn: string | null;
|
|
8
|
+
cacheControl: string | null;
|
|
9
|
+
etag: string | null;
|
|
10
|
+
lastModified: string | null;
|
|
11
|
+
expires: string | null;
|
|
12
|
+
hsts: string | null;
|
|
13
|
+
xFrameOptions: string | null;
|
|
14
|
+
csp: string | null;
|
|
15
|
+
xContentTypeOptions: string | null;
|
|
16
|
+
cors: string | null;
|
|
17
|
+
contentEncoding: string | null;
|
|
18
|
+
sslCert: {
|
|
19
|
+
valid: boolean;
|
|
20
|
+
issuer?: string;
|
|
21
|
+
validFrom?: string;
|
|
22
|
+
validTo?: string;
|
|
23
|
+
} | null;
|
|
24
|
+
humansTxt: boolean;
|
|
25
|
+
securityTxt: boolean;
|
|
26
|
+
faviconStatus: number | null;
|
|
27
|
+
analytics: string[];
|
|
28
|
+
urlPatterns: {
|
|
29
|
+
pattern: string;
|
|
30
|
+
count: number;
|
|
31
|
+
}[];
|
|
32
|
+
maxDepth: number;
|
|
33
|
+
redirectCount: number;
|
|
34
|
+
thirdPartyDomains: string[];
|
|
35
|
+
iframeAllowed: boolean | null;
|
|
36
|
+
}
|
|
37
|
+
export declare class SeoScanner implements INodeType {
|
|
38
|
+
description: INodeTypeDescription;
|
|
39
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
40
|
+
}
|