Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions nodes/MarkdownifyDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ export const markdownifyOperations: INodeProperties[] = [
action: 'Convert a webpage or article to clean markdown useful for blogs dev docs and more',
description: 'Convert a webpage or article to clean markdown – useful for blogs, dev docs and more',
},
{
name: 'Get Status',
value: 'getStatus',
action: 'Get the status and results of a conversion',
description: 'Retrieve the status and results of a markdown conversion by request ID',
},
],
default: 'convert',
},
];

export const markdownifyFields: INodeProperties[] = [
// Fields for getStatus operation
{
displayName: 'Request ID',
name: 'requestId',
type: 'string',
required: true,
default: '',
description: 'The request ID returned from a convert operation',
displayOptions: {
show: {
resource: ['markdownify'],
operation: ['getStatus'],
},
},
},
// Fields for convert operation
{
displayName: 'Website URL',
name: 'websiteUrl',
Expand Down
47 changes: 47 additions & 0 deletions nodes/ScrapegraphAI/ScrapegraphAi.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,36 @@ export class ScrapegraphAi implements INodeType {

returnData.push({ json: response, pairedItem: { item: i } });
}

if (operation === 'getStatus') {
const requestId = this.getNodeParameter('requestId', i) as string;

const response = await this.helpers.httpRequestWithAuthentication.call(this, 'scrapegraphAIApi', {
method: 'GET',
url: `${baseUrl}/smartscraper/${requestId}`,
headers: {
'Accept': 'application/json',
},
json: true,
});

returnData.push({ json: response, pairedItem: { item: i } });
}
}

if (resource === 'searchscraper') {
if (operation === 'search') {
const userPrompt = this.getNodeParameter('userPrompt', i) as string;
const numResults = this.getNodeParameter('numResults', i) as number;
const extractionMode = this.getNodeParameter('extractionMode', i, true) as boolean;
const enableScrolling = this.getNodeParameter('enableScrolling', i, false) as boolean;
const enablePagination = this.getNodeParameter('enablePagination', i, false) as boolean;
const useOutputSchema = this.getNodeParameter('useOutputSchema', i, false) as boolean;

const requestBody: any = {
user_prompt: userPrompt,
num_results: numResults,
extraction_mode: extractionMode,
};

// Add number_of_scrolls if scrolling is enabled
Expand Down Expand Up @@ -202,6 +219,21 @@ export class ScrapegraphAi implements INodeType {

returnData.push({ json: response, pairedItem: { item: i } });
}

if (operation === 'getStatus') {
const requestId = this.getNodeParameter('requestId', i) as string;

const response = await this.helpers.httpRequestWithAuthentication.call(this, 'scrapegraphAIApi', {
method: 'GET',
url: `${baseUrl}/searchscraper/${requestId}`,
headers: {
'Accept': 'application/json',
},
json: true,
});

returnData.push({ json: response, pairedItem: { item: i } });
}
}

if (resource === 'smartcrawler') {
Expand Down Expand Up @@ -286,6 +318,21 @@ export class ScrapegraphAi implements INodeType {

returnData.push({ json: response, pairedItem: { item: i } });
}

if (operation === 'getStatus') {
const requestId = this.getNodeParameter('requestId', i) as string;

const response = await this.helpers.httpRequestWithAuthentication.call(this, 'scrapegraphAIApi', {
method: 'GET',
url: `${baseUrl}/markdownify/${requestId}`,
headers: {
'Accept': 'application/json',
},
json: true,
});

returnData.push({ json: response, pairedItem: { item: i } });
}
}

if (resource === 'scrape') {
Expand Down
35 changes: 35 additions & 0 deletions nodes/SearchscraperDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ export const searchscraperOperations: INodeProperties[] = [
action: 'Perform ai powered site wide search and structured data extraction ideal for knowledge retrieval',
description: 'Perform AI-powered site-wide search and structured data extraction – ideal for knowledge retrieval',
},
{
name: 'Get Status',
value: 'getStatus',
action: 'Get the status and results of a search operation',
description: 'Retrieve the status and results of a search scraping operation by request ID',
},
],
default: 'search',
},
];

export const searchscraperFields: INodeProperties[] = [
// Fields for getStatus operation
{
displayName: 'Request ID',
name: 'requestId',
type: 'string',
required: true,
default: '',
description: 'The request ID returned from a search operation',
displayOptions: {
show: {
resource: ['searchscraper'],
operation: ['getStatus'],
},
},
},
// Fields for search operation
{
displayName: 'User Prompt',
name: 'userPrompt',
Expand Down Expand Up @@ -97,6 +119,19 @@ export const searchscraperFields: INodeProperties[] = [
},
],
},
{
displayName: 'Extraction Mode',
name: 'extractionMode',
type: 'boolean',
default: true,
description: 'Whether to use AI extraction (true) for structured data or markdown conversion (false) for raw content',
displayOptions: {
show: {
resource: ['searchscraper'],
operation: ['search'],
},
},
},
{
displayName: 'Enable Infinite Scrolling',
name: 'enableScrolling',
Expand Down
22 changes: 22 additions & 0 deletions nodes/SmartscraperDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ export const smartscraperOperations: INodeProperties[] = [
action: 'Autonomously extract live data from any website perfect for e commerce job boards lead capture and more',
description: 'Autonomously extract live data from any website – perfect for e-commerce, job boards, lead capture and more',
},
{
name: 'Get Status',
value: 'getStatus',
action: 'Get the status and results of a scraping operation',
description: 'Retrieve the status and results of a scraping operation by request ID',
},
],
default: 'scrape',
},
];

export const smartscraperFields: INodeProperties[] = [
// Fields for getStatus operation
{
displayName: 'Request ID',
name: 'requestId',
type: 'string',
required: true,
default: '',
description: 'The request ID returned from a scrape operation',
displayOptions: {
show: {
resource: ['smartscraper'],
operation: ['getStatus'],
},
},
},
// Fields for scrape operation
{
displayName: 'Website URL',
name: 'websiteUrl',
Expand Down