From d2090061c13aff4647999b1d8725f774c9fe599b Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Thu, 2 Nov 2023 18:37:11 +0100 Subject: Refactor stdlib to more generic functions --- examples/hackernews_login.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'examples') 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 }) { -- cgit v1.2.3