justbrowse.io
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

justbrowse.io

A nodejs package to interact with the justbrowse.io

Installation

npm i justbrowse.io
pnpm add justbrowse.io
yarn add justbrowse.io

Usage

ChatGPT

We create our client:

import { ChatGPT } from "justbrowse.io";
const sessionToken = "Read Bellow how to get your chatgpt session token";
const apiToken = "Go to https://justbrowse.io to get your api token"; // API token is now optional

(async () => {
  var client = new ChatGPT(sessionToken);
  // var client = new Client(sessionToken, apiToken);
  await client.init();
  // check status:
  var status = await client.status();
  if (status == "ready") {
    // Send a message:
    var response = await client.chat("message");
    console.log(response);
    // Create a new conversation:
    var conversation = await client.createConversation();
    // send a message to the conversation:
    var res = await conversation.sendMessage("message", message);
    console.log(res);
  }
})();

Get your session token:

  1. Go to https://chat.openai.com/chat
  2. Log in to your account
  3. Open developer tools
  4. Go to the application section
  5. Go to the cookies section
  6. And get your session token which is the cookie with the name: "__Secure-next-auth.session-token"

Crawler

import { Crawl } from "justbrowse.io";
(async () => {
  // Crawl html
  var { requestId, html } = await Crawl(
    "html",
    "https://google.com?q=news+for+today"
  );
  console.log(requestId, html);

  // Crawl text
  var { requestId, text } = await Crawl(
    "text",
    "https://google.com?q=news+for+today"
  );
  console.log(requestId, text);
})();

Package Sidebar

Install

npm i justbrowse.io

Weekly Downloads

0

Version

0.1.2

License

Apache-2.0

Unpacked Size

27.8 kB

Total Files

20

Last publish

Collaborators

  • mrlol