summaryrefslogtreecommitdiff
path: root/examples/hackernews_login.js
diff options
context:
space:
mode:
authorPhilipp Tanlak <philipp.tanlak@gmail.com>2023-11-02 18:37:11 +0100
committerPhilipp Tanlak <philipp.tanlak@gmail.com>2023-11-02 18:37:11 +0100
commitd2090061c13aff4647999b1d8725f774c9fe599b (patch)
treef323a298a507ed116245abe497f3e8c55d6b24c0 /examples/hackernews_login.js
parentaadd80b3b213988aa5701075f2650198e4066349 (diff)
Refactor stdlib to more generic functions
Diffstat (limited to 'examples/hackernews_login.js')
-rw-r--r--examples/hackernews_login.js11
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 }) {