diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/urls.txt | 3 | ||||
| -rw-r--r-- | examples/urls_from_file.js | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/urls.txt b/examples/urls.txt new file mode 100644 index 0000000..0d4b500 --- /dev/null +++ b/examples/urls.txt @@ -0,0 +1,3 @@ +https://news.ycombinator.com/newest +https://news.ycombinator.com/ask +https://news.ycombinator.com/show diff --git a/examples/urls_from_file.js b/examples/urls_from_file.js new file mode 100644 index 0000000..0231032 --- /dev/null +++ b/examples/urls_from_file.js @@ -0,0 +1,11 @@ +import urls from "./urls.txt" + +export const config = { + urls: urls.split("\n").filter(Boolean) +}; + +export default function({ doc }) { + return { + title: doc.find("title").text().trim(), + }; +} |