recker 1.0.75-next.a400152 → 1.0.75
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/dist/browser/seo/index.d.ts +0 -2
- package/dist/browser/seo/index.js +0 -1
- package/dist/search/google.d.ts +0 -3
- package/dist/search/google.js +0 -137
- package/dist/search/index.d.ts +1 -1
- package/dist/seo/index.d.ts +0 -2
- package/dist/seo/index.js +0 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/browser/search/google.d.ts +0 -70
- package/dist/browser/search/google.js +0 -617
- package/dist/browser/seo/keyword-campaign.d.ts +0 -107
- package/dist/browser/seo/keyword-campaign.js +0 -380
- package/dist/seo/keyword-campaign.d.ts +0 -107
- package/dist/seo/keyword-campaign.js +0 -380
|
@@ -15,5 +15,3 @@ export { parseSitemap, validateSitemap, discoverSitemaps, fetchAndValidateSitema
|
|
|
15
15
|
export type { SitemapUrl, SitemapIndex, SitemapParseResult, SitemapValidationIssue, SitemapValidationResult, } from './validators/sitemap.js';
|
|
16
16
|
export { parseLlmsTxt, validateLlmsTxt, fetchAndValidateLlmsTxt, generateLlmsTxtTemplate, } from './validators/llms-txt.js';
|
|
17
17
|
export type { LlmsTxtLink, LlmsTxtSection, LlmsTxtParseResult, LlmsTxtValidationIssue, LlmsTxtValidationResult, } from './validators/llms-txt.js';
|
|
18
|
-
export { analyzeKeywordCampaign, extractKeywordCampaignSeedsFromReport, } from './keyword-campaign.js';
|
|
19
|
-
export type { CampaignActivitySignal, CampaignResultPlacement, KeywordCampaignCompetitorResult, KeywordCampaignCompetitorSummary, KeywordCampaignExtractionOptions, KeywordCampaignOptions, KeywordCampaignPageStats, KeywordCampaignReport, KeywordCampaignResult, KeywordCampaignSeed, KeywordCampaignSeedInput, KeywordCampaignSource, KeywordCampaignSummary, } from './keyword-campaign.js';
|
|
@@ -6,4 +6,3 @@ export { generateSeoFilename, resolveOutputPath, writeReport, formatReportForJso
|
|
|
6
6
|
export { parseRobotsTxt, validateRobotsTxt, isPathAllowed, fetchAndValidateRobotsTxt, } from './validators/robots.js';
|
|
7
7
|
export { parseSitemap, validateSitemap, discoverSitemaps, fetchAndValidateSitemap, } from './validators/sitemap.js';
|
|
8
8
|
export { parseLlmsTxt, validateLlmsTxt, fetchAndValidateLlmsTxt, generateLlmsTxtTemplate, } from './validators/llms-txt.js';
|
|
9
|
-
export { analyzeKeywordCampaign, extractKeywordCampaignSeedsFromReport, } from './keyword-campaign.js';
|
package/dist/search/google.d.ts
CHANGED
|
@@ -38,15 +38,12 @@ export interface GoogleSearchAdvancedOptions {
|
|
|
38
38
|
headers?: HeadersInit;
|
|
39
39
|
includeRawHtml?: boolean;
|
|
40
40
|
}
|
|
41
|
-
export type GoogleSearchResultPlacement = 'ad' | 'organic' | 'unknown';
|
|
42
41
|
export interface GoogleSearchResult {
|
|
43
42
|
rank: number;
|
|
44
43
|
title: string;
|
|
45
44
|
url: string;
|
|
46
45
|
snippet?: string;
|
|
47
46
|
displayedUrl?: string;
|
|
48
|
-
placement?: GoogleSearchResultPlacement;
|
|
49
|
-
placementHint?: string;
|
|
50
47
|
source?: string;
|
|
51
48
|
}
|
|
52
49
|
export interface SearchTransportDetails {
|
package/dist/search/google.js
CHANGED
|
@@ -23,29 +23,6 @@ const GOOGLE_RESULT_LINK_SELECTORS = [
|
|
|
23
23
|
'a[href^="http://www.google.com/url?"]',
|
|
24
24
|
];
|
|
25
25
|
const GOOGLE_RESULT_CONTAINER_SELECTORS = '[data-hveid], [data-ved], div[class*="g"], div[class*="MjjY"], div[class*="tF2Cxc"], [class*="xpd"]';
|
|
26
|
-
const GOOGLE_AD_CONTAINER_CLASS_HINTS = [
|
|
27
|
-
'ad',
|
|
28
|
-
'ads',
|
|
29
|
-
'sponsored',
|
|
30
|
-
'ad_cx',
|
|
31
|
-
'pla',
|
|
32
|
-
'shopping',
|
|
33
|
-
'uEierd',
|
|
34
|
-
];
|
|
35
|
-
const GOOGLE_AD_TEXT_HINTS = [
|
|
36
|
-
'anúncio',
|
|
37
|
-
'anuncio',
|
|
38
|
-
'sponsored',
|
|
39
|
-
'patrocinado',
|
|
40
|
-
'patrocinada',
|
|
41
|
-
'patrocínio',
|
|
42
|
-
'publi',
|
|
43
|
-
'publicidade',
|
|
44
|
-
'ad',
|
|
45
|
-
'ads',
|
|
46
|
-
'anúncios',
|
|
47
|
-
'anunciante',
|
|
48
|
-
];
|
|
49
26
|
const COUNTRY_CODE_PATTERN = /^[a-z]{2}$/;
|
|
50
27
|
const COUNTRY_ALIASES = {
|
|
51
28
|
us: 'us',
|
|
@@ -371,117 +348,6 @@ function looksLikeSnippet(text, title) {
|
|
|
371
348
|
return false;
|
|
372
349
|
return true;
|
|
373
350
|
}
|
|
374
|
-
function escapeRegex(value) {
|
|
375
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
376
|
-
}
|
|
377
|
-
function hasAdHintText(value) {
|
|
378
|
-
if (!value)
|
|
379
|
-
return false;
|
|
380
|
-
const normalized = cleanText(value).toLowerCase();
|
|
381
|
-
if (!normalized)
|
|
382
|
-
return false;
|
|
383
|
-
return GOOGLE_AD_TEXT_HINTS.some((hint) => {
|
|
384
|
-
const pattern = new RegExp(`(^|\\W)${escapeRegex(hint)}(\\W|$)`, 'i');
|
|
385
|
-
return pattern.test(normalized);
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
function hasAdClassHint(className) {
|
|
389
|
-
if (!className)
|
|
390
|
-
return false;
|
|
391
|
-
const normalized = cleanText(className).toLowerCase();
|
|
392
|
-
if (!normalized)
|
|
393
|
-
return false;
|
|
394
|
-
return GOOGLE_AD_CONTAINER_CLASS_HINTS.some((hint) => {
|
|
395
|
-
const classes = normalized.split(/\s+/);
|
|
396
|
-
return classes.some((token) => token === hint || token.startsWith(`${hint}-`));
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
function detectResultPlacement(anchor, container) {
|
|
400
|
-
const isScrapeElementLike = (value) => {
|
|
401
|
-
if (value === null || value === undefined)
|
|
402
|
-
return false;
|
|
403
|
-
if (typeof value !== 'object')
|
|
404
|
-
return false;
|
|
405
|
-
const candidate = value;
|
|
406
|
-
return 'length' in candidate
|
|
407
|
-
&& typeof candidate.length === 'number'
|
|
408
|
-
&& typeof candidate.attrs === 'function';
|
|
409
|
-
};
|
|
410
|
-
const isResultContainer = (node) => {
|
|
411
|
-
const tag = (() => {
|
|
412
|
-
const raw = node;
|
|
413
|
-
if (typeof raw.tagName === 'function')
|
|
414
|
-
return raw.tagName().toLowerCase();
|
|
415
|
-
if (typeof raw.tagName === 'string')
|
|
416
|
-
return raw.tagName.toLowerCase();
|
|
417
|
-
return '';
|
|
418
|
-
})();
|
|
419
|
-
return tag !== 'body' && tag !== 'html';
|
|
420
|
-
};
|
|
421
|
-
const anchorParent = typeof anchor.parent === 'function' ? anchor.parent() : undefined;
|
|
422
|
-
const containerParent = typeof container.parent === 'function' ? container.parent() : undefined;
|
|
423
|
-
const anchorNext = typeof anchor.next === 'function' ? anchor.next() : undefined;
|
|
424
|
-
const anchorPrev = typeof anchor.prev === 'function' ? anchor.prev() : undefined;
|
|
425
|
-
const checkList = [
|
|
426
|
-
anchor,
|
|
427
|
-
anchorParent,
|
|
428
|
-
container,
|
|
429
|
-
containerParent,
|
|
430
|
-
anchorNext,
|
|
431
|
-
anchorPrev,
|
|
432
|
-
].filter((node) => {
|
|
433
|
-
if (!isScrapeElementLike(node) || node.length === 0)
|
|
434
|
-
return false;
|
|
435
|
-
return isResultContainer(node);
|
|
436
|
-
});
|
|
437
|
-
for (const node of checkList) {
|
|
438
|
-
const attributes = node.attrs();
|
|
439
|
-
const className = node.attr('class');
|
|
440
|
-
const dataAttributeKeys = Object.keys(attributes).filter((key) => {
|
|
441
|
-
const normalized = key.toLowerCase();
|
|
442
|
-
return normalized === 'data-text-ad'
|
|
443
|
-
|| normalized === 'data-rw'
|
|
444
|
-
|| normalized === 'data-snc'
|
|
445
|
-
|| normalized.startsWith('data-ad-')
|
|
446
|
-
|| normalized === 'data-ved'
|
|
447
|
-
|| normalized === 'data-pcu';
|
|
448
|
-
});
|
|
449
|
-
if (dataAttributeKeys.length > 0) {
|
|
450
|
-
return {
|
|
451
|
-
placement: 'ad',
|
|
452
|
-
placementHint: cleanText(`${dataAttributeKeys.join(' ')} ${node.text()}`.slice(0, 120)),
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
const dataAttributes = Object.entries(attributes)
|
|
456
|
-
.filter(([key]) => key.startsWith('data-'))
|
|
457
|
-
.map(([, value]) => value)
|
|
458
|
-
.filter((value) => typeof value === 'string');
|
|
459
|
-
const text = cleanText(node.text());
|
|
460
|
-
const dataText = dataAttributes.join(' ');
|
|
461
|
-
if (hasAdHintText(node.attr('data-ved'))) {
|
|
462
|
-
return {
|
|
463
|
-
placement: 'ad',
|
|
464
|
-
placementHint: cleanText(`${text} ${dataText}`.slice(0, 120)),
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
if (hasAdClassHint(className) || hasAdHintText(dataText)) {
|
|
468
|
-
return {
|
|
469
|
-
placement: 'ad',
|
|
470
|
-
placementHint: cleanText(`${className} ${dataText}`.slice(0, 120)),
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
if (hasAdHintText(text)) {
|
|
474
|
-
return {
|
|
475
|
-
placement: 'ad',
|
|
476
|
-
placementHint: text,
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
return {
|
|
481
|
-
placement: 'organic',
|
|
482
|
-
placementHint: undefined,
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
351
|
function parseResultStats(text) {
|
|
486
352
|
const normalized = text.replace(/,/g, '');
|
|
487
353
|
const match = normalized.match(/([0-9]+)\s*(?:result|resultado)/i);
|
|
@@ -514,7 +380,6 @@ function parseSearchPage(html, options) {
|
|
|
514
380
|
if (!titleText)
|
|
515
381
|
continue;
|
|
516
382
|
const resultContainer = anchor.parents(GOOGLE_RESULT_CONTAINER_SELECTORS).first();
|
|
517
|
-
const placement = detectResultPlacement(anchor, resultContainer);
|
|
518
383
|
const snippet = (() => {
|
|
519
384
|
for (const selector of GOOGLE_RESULT_SNIPPET_SELECTOR_ORDER) {
|
|
520
385
|
const snippetNode = resultContainer.find(selector).first();
|
|
@@ -542,8 +407,6 @@ function parseSearchPage(html, options) {
|
|
|
542
407
|
url: resultUrl,
|
|
543
408
|
snippet,
|
|
544
409
|
displayedUrl: extractDisplayedUrl(resultUrl, anchor.text()),
|
|
545
|
-
placement: placement.placement,
|
|
546
|
-
placementHint: placement.placementHint,
|
|
547
410
|
};
|
|
548
411
|
results.push(item);
|
|
549
412
|
seen.add(resultUrl);
|
package/dist/search/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { searchGoogleAdvanced } from './google.js';
|
|
2
|
-
export type { GoogleSearchAdvancedOptions, GoogleSearchResult,
|
|
2
|
+
export type { GoogleSearchAdvancedOptions, GoogleSearchResult, GoogleSearchResponse, SearchTransportDetails, } from './google.js';
|
|
3
3
|
export type { SearchTransport } from './google.js';
|
package/dist/seo/index.d.ts
CHANGED
|
@@ -15,5 +15,3 @@ export { parseSitemap, validateSitemap, discoverSitemaps, fetchAndValidateSitema
|
|
|
15
15
|
export type { SitemapUrl, SitemapIndex, SitemapParseResult, SitemapValidationIssue, SitemapValidationResult, } from './validators/sitemap.js';
|
|
16
16
|
export { parseLlmsTxt, validateLlmsTxt, fetchAndValidateLlmsTxt, generateLlmsTxtTemplate, } from './validators/llms-txt.js';
|
|
17
17
|
export type { LlmsTxtLink, LlmsTxtSection, LlmsTxtParseResult, LlmsTxtValidationIssue, LlmsTxtValidationResult, } from './validators/llms-txt.js';
|
|
18
|
-
export { analyzeKeywordCampaign, extractKeywordCampaignSeedsFromReport, } from './keyword-campaign.js';
|
|
19
|
-
export type { CampaignActivitySignal, CampaignResultPlacement, KeywordCampaignCompetitorResult, KeywordCampaignCompetitorSummary, KeywordCampaignExtractionOptions, KeywordCampaignOptions, KeywordCampaignPageStats, KeywordCampaignReport, KeywordCampaignResult, KeywordCampaignSeed, KeywordCampaignSeedInput, KeywordCampaignSource, KeywordCampaignSummary, } from './keyword-campaign.js';
|
package/dist/seo/index.js
CHANGED
|
@@ -6,4 +6,3 @@ export { generateSeoFilename, resolveOutputPath, writeReport, formatReportForJso
|
|
|
6
6
|
export { parseRobotsTxt, validateRobotsTxt, isPathAllowed, fetchAndValidateRobotsTxt, } from './validators/robots.js';
|
|
7
7
|
export { parseSitemap, validateSitemap, discoverSitemaps, fetchAndValidateSitemap, } from './validators/sitemap.js';
|
|
8
8
|
export { parseLlmsTxt, validateLlmsTxt, fetchAndValidateLlmsTxt, generateLlmsTxtTemplate, } from './validators/llms-txt.js';
|
|
9
|
-
export { analyzeKeywordCampaign, extractKeywordCampaignSeedsFromReport, } from './keyword-campaign.js';
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recker",
|
|
3
|
-
"version": "1.0.75
|
|
3
|
+
"version": "1.0.75",
|
|
4
4
|
"description": "Multi-Protocol SDK for the AI Era - HTTP, WebSocket, DNS, FTP, SFTP, Telnet, HLS unified with AI providers and MCP tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { type BlockDetectionResult } from '../utils/block-detector.js';
|
|
2
|
-
type SearchTransport = 'auto' | 'undici' | 'curl';
|
|
3
|
-
export type { SearchTransport };
|
|
4
|
-
export interface GoogleSearchAdvancedOptions {
|
|
5
|
-
asQ?: string;
|
|
6
|
-
as_q?: string;
|
|
7
|
-
asEpq?: string;
|
|
8
|
-
as_epq?: string;
|
|
9
|
-
asOq?: string;
|
|
10
|
-
as_oq?: string;
|
|
11
|
-
asEq?: string;
|
|
12
|
-
as_eq?: string;
|
|
13
|
-
asSitesearch?: string;
|
|
14
|
-
as_sitesearch?: string;
|
|
15
|
-
asFiletype?: string;
|
|
16
|
-
as_filetype?: string;
|
|
17
|
-
asRights?: string;
|
|
18
|
-
as_rights?: string;
|
|
19
|
-
asNlo?: number | string;
|
|
20
|
-
as_nlo?: number | string;
|
|
21
|
-
asNhi?: number | string;
|
|
22
|
-
as_nhi?: number | string;
|
|
23
|
-
safe?: string;
|
|
24
|
-
tbm?: string;
|
|
25
|
-
num?: number;
|
|
26
|
-
start?: number;
|
|
27
|
-
tbs?: string;
|
|
28
|
-
lr?: string;
|
|
29
|
-
cr?: string;
|
|
30
|
-
country?: string;
|
|
31
|
-
gl?: string;
|
|
32
|
-
hl?: string;
|
|
33
|
-
transport?: SearchTransport;
|
|
34
|
-
timeout?: number;
|
|
35
|
-
maxResults?: number;
|
|
36
|
-
extraParams?: Record<string, string | number | boolean>;
|
|
37
|
-
userAgent?: string;
|
|
38
|
-
headers?: HeadersInit;
|
|
39
|
-
includeRawHtml?: boolean;
|
|
40
|
-
}
|
|
41
|
-
export type GoogleSearchResultPlacement = 'ad' | 'organic' | 'unknown';
|
|
42
|
-
export interface GoogleSearchResult {
|
|
43
|
-
rank: number;
|
|
44
|
-
title: string;
|
|
45
|
-
url: string;
|
|
46
|
-
snippet?: string;
|
|
47
|
-
displayedUrl?: string;
|
|
48
|
-
placement?: GoogleSearchResultPlacement;
|
|
49
|
-
placementHint?: string;
|
|
50
|
-
source?: string;
|
|
51
|
-
}
|
|
52
|
-
export interface SearchTransportDetails {
|
|
53
|
-
requested: SearchTransport;
|
|
54
|
-
used: SearchTransport;
|
|
55
|
-
fallbackUsed: boolean;
|
|
56
|
-
impersonateAvailable: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface GoogleSearchResponse {
|
|
59
|
-
query: string;
|
|
60
|
-
searchUrl: string;
|
|
61
|
-
results: GoogleSearchResult[];
|
|
62
|
-
nextPageUrl?: string;
|
|
63
|
-
nextPageStart?: number;
|
|
64
|
-
resultStats?: number;
|
|
65
|
-
block?: BlockDetectionResult;
|
|
66
|
-
transport: SearchTransportDetails;
|
|
67
|
-
status?: number;
|
|
68
|
-
rawHtml?: string;
|
|
69
|
-
}
|
|
70
|
-
export declare function searchGoogleAdvanced(query: string, options?: GoogleSearchAdvancedOptions): Promise<GoogleSearchResponse>;
|