Earn 2,106 ($21.06)
Convert former Github CEO's Python code file into Javascript - Use no librares & should run in console of any webpage
Bounty Description
Problem Description
Nat Friedman & a collaborator wrote this Python file recently. It drives a web browser using GPT-3, passing in a simplified DOM as part of the prompt. GPT3 uses the prompt + simplified DOM/browser content to issue 'commands'.
Here's the file:
https://github.com/nat/natbot/blob/main/natbot.py
The focus here is getting a simplified DOM - (the browser_content var in the file) - using just JS and no external library (e.g. no Playwright lib). It should be JS I can run in my console.
Acceptance Criteria
I should be able to paste your JS code into any webpage and have it return a simplified DOM that's identical/near-identical to the browser_content in this python code.
I should be able to run 'click(id)', type('id') etc. just like this python file https://github.com/nat/natbot/blob/f99518d3deee33cb117166049e1c99314080f7e5/natbot.py#L191 - the id's should map the simplified DOM aka browser_content to actual elements. And the actions should act on those elements.
You do not need to implement the GPT api or prompt content.
For reference: here's how someone did it in ruby: https://github.com/jheitzeb/ruby-gpt3-commander/blob/main/html_cleaner.rb
Willing to work with the bounty hunter in real time if preferred.
If you must use an external script loaded library, email me.