-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search and updated get page tools. (#322)
- Loading branch information
Showing
3 changed files
with
382 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
195 changes: 195 additions & 0 deletions
195
seeds/team-experiments/graphs/bgl/insta/tool-get-web-page.bgl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
{ | ||
"title": "Get Web Page Content", | ||
"description": "Returns the contents of a web page at a given URL.", | ||
"version": "0.0.1", | ||
"nodes": [ | ||
{ | ||
"type": "input", | ||
"id": "input", | ||
"configuration": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"title": "URL", | ||
"examples": [] | ||
} | ||
}, | ||
"required": [] | ||
} | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 19, | ||
"y": 538.0000000000001 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "output", | ||
"id": "output", | ||
"configuration": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"json": { | ||
"type": "object", | ||
"title": "JSON", | ||
"examples": [] | ||
} | ||
}, | ||
"required": [] | ||
} | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 595, | ||
"y": 505.00000000000006 | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "fetch-27da0eda", | ||
"type": "fetch", | ||
"metadata": { | ||
"visual": { | ||
"x": 568.0000000000001, | ||
"y": 151 | ||
}, | ||
"title": "Scraping Bee", | ||
"description": "Calling Scraping Bee to Get the Contents", | ||
"logLevel": "debug" | ||
}, | ||
"configuration": { | ||
"method": "GET" | ||
} | ||
}, | ||
{ | ||
"id": "urlTemplate-77553e6f", | ||
"type": "urlTemplate", | ||
"configuration": { | ||
"template": "https://app.scrapingbee.com/api/v1/?api_key={SCRAPING_BEE_KEY}&url={url}&extract_rules={extract_rules}&js_scenario={js_scenario}&json_response=true" | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 318, | ||
"y": 193.00000000000003 | ||
}, | ||
"title": "Scraping Bee API Template", | ||
"logLevel": "debug" | ||
} | ||
}, | ||
{ | ||
"id": "secrets-197969de", | ||
"type": "secrets", | ||
"configuration": { | ||
"keys": [ | ||
"SCRAPING_BEE_KEY" | ||
] | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 25, | ||
"y": 4.000000000000007 | ||
}, | ||
"title": "Get API Key", | ||
"description": "Asking for API Key", | ||
"logLevel": "debug" | ||
} | ||
}, | ||
{ | ||
"id": "jsonata-02f9c069", | ||
"type": "jsonata", | ||
"configuration": { | ||
"expression": "(\n $results := $eval(evaluate_results[0]);\n{ \"title\": body.title, \"body\": $results.data, \"links\": $results.links }\n)" | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 366, | ||
"y": 500.99999999999994 | ||
}, | ||
"title": "Format Output", | ||
"logLevel": "debug" | ||
} | ||
}, | ||
{ | ||
"id": "jsonata-c018bbf7", | ||
"type": "jsonata", | ||
"configuration": { | ||
"expression": "$string({ \"title\": \"title\" })", | ||
"json": "{}" | ||
}, | ||
"metadata": { | ||
"visual": { | ||
"x": 23, | ||
"y": 165.00000000000003 | ||
}, | ||
"title": "Extract Rules", | ||
"description": "Specifying the rules to extract content", | ||
"logLevel": "debug" | ||
} | ||
}, | ||
{ | ||
"id": "jsonata-a145253b", | ||
"type": "jsonata", | ||
"metadata": { | ||
"title": "JS Scenario", | ||
"description": "Specifying JS to evaluate", | ||
"logLevel": "debug", | ||
"visual": { | ||
"x": 17, | ||
"y": 349 | ||
} | ||
}, | ||
"configuration": { | ||
"expression": "$string({\n \"instructions\":[ {\"evaluate\": $ }]\n})", | ||
"json": "JSON.stringify({ data: document.body.innerText, links: Array.from(document.querySelectorAll(\"a\")).map((a) => ({ href: a.href, title: a.innerText.trim() }))})" | ||
} | ||
} | ||
], | ||
"edges": [ | ||
{ | ||
"from": "input", | ||
"to": "urlTemplate-77553e6f", | ||
"out": "url", | ||
"in": "url" | ||
}, | ||
{ | ||
"from": "urlTemplate-77553e6f", | ||
"to": "fetch-27da0eda", | ||
"out": "url", | ||
"in": "url" | ||
}, | ||
{ | ||
"from": "secrets-197969de", | ||
"to": "urlTemplate-77553e6f", | ||
"out": "SCRAPING_BEE_KEY", | ||
"in": "SCRAPING_BEE_KEY" | ||
}, | ||
{ | ||
"from": "jsonata-02f9c069", | ||
"to": "output", | ||
"out": "result", | ||
"in": "text" | ||
}, | ||
{ | ||
"from": "fetch-27da0eda", | ||
"to": "jsonata-02f9c069", | ||
"out": "response", | ||
"in": "json" | ||
}, | ||
{ | ||
"from": "jsonata-c018bbf7", | ||
"to": "urlTemplate-77553e6f", | ||
"out": "result", | ||
"in": "extract_rules" | ||
}, | ||
{ | ||
"from": "jsonata-a145253b", | ||
"to": "urlTemplate-77553e6f", | ||
"out": "result", | ||
"in": "js_scenario" | ||
} | ||
] | ||
} |
Oops, something went wrong.