diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-11-02 18:37:11 +0100 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-11-02 18:37:11 +0100 |
| commit | d2090061c13aff4647999b1d8725f774c9fe599b (patch) | |
| tree | f323a298a507ed116245abe497f3e8c55d6b24c0 /examples | |
| parent | aadd80b3b213988aa5701075f2650198e4066349 (diff) | |
Refactor stdlib to more generic functions
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hackernews_login.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/hackernews_login.js b/examples/hackernews_login.js index 371b8b7..aea9442 100644 --- a/examples/hackernews_login.js +++ b/examples/hackernews_login.js @@ -1,16 +1,15 @@ -import { submitForm } from "flyscrape" +import { parse } from "flyscrape" +import http from "flyscrape/http" export const config = { url: "https://news.ycombinator.com", } -export function login() { - const formData = { +export function setup() { + http.postForm("https://news.ycombinator.com/login", { "acct": "my-username", "pw": "my-password", - } - - submitForm("https://news.ycombinator.com/login", formData) + }) } export default function ({ doc }) { |