https://github.com/pocesar/actor-request-list-bridge
Adds requestList requestsFromUrl to actors that don't support it
https://github.com/pocesar/actor-request-list-bridge
Last synced: about 1 year ago
JSON representation
Adds requestList requestsFromUrl to actors that don't support it
- Host: GitHub
- URL: https://github.com/pocesar/actor-request-list-bridge
- Owner: pocesar
- License: apache-2.0
- Created: 2020-09-03T14:34:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T21:07:08.000Z (almost 6 years ago)
- Last Synced: 2024-10-18T06:29:00.297Z (over 1 year ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RequestList Bridge
Allows you to filter (thus cleaning up your list) and append new data to those requests before
sending to your target task.
Also enables a workaround to provide `requestsFromUrl` to existing actors that dont't support it natively.
## Example
Target task accepts a `startUrls` but as a plain string array:
```jsonc
{
"taskId": "x02LumCy0WXdGP7nt",
"requestListSources": [
{
"requestsFromUrl": "https://apify-uploads-prod.s3.amazonaws.com/Hhewqx4YNnyWz2qGk-data.csv"
}
],
"plainArray": true,
"targetStartUrlsProperty": "startUrls"
}
```
Target task accepts `RequestQueue` only:
```jsonc
{
"taskId": "x02LumCy0WXdGP7nt",
"requestListSources": [
{
"requestsFromUrl": "https://apify-uploads-prod.s3.amazonaws.com/Hhewqx4YNnyWz2qGk-data.csv"
}
],
"targetStartUrlsProperty": "startUrls"
}
```
Filter out and transform the requests:
```js
{
filter: (req) => /apify/i.test(req.url),
map: (req) => {
req.userData.isMapped = true;
return req;
},
}
```
## License
Apache 2.0