gpt4scrape
v1.0.2
Published
Unofficial scrape for gpt-4
Downloads
12
Readme
gpt4scrape
Overview
gpt4scrape
is an unofficial tool for scraping GPT-4 using a free chatGPT4 website. This project is designed for fun and educational purposes, not for business or commercial use. The package leverages Playwright to capture WP Nonce tokens from network requests, which is a challenging task to accomplish using fetch. Contributions are welcome, especially if someone finds a way to achieve the same functionality using fetch.
Installation
To install the package and its dependencies, run:
npm install gpt4scrape
Usage
Here is an example of how to use the gpt4scrape
package to interact with GPT-4.
Initializing and Sending Messages
- Initialize the chatbot and get the WP Nonce token.
- Send a series of messages to the chatbot.
const { InitialChatbot, ChatClient } = require('gpt4scrape');
async function runExample() {
// Step 1: Initialize InitialChatbot and retrieve the nonce token
const initialChatbot = new InitialChatbot();
await initialChatbot.initialize();
const nonce = initialChatbot.getNonce();
console.log('Initial nonce:', nonce);
// Step 2: Create ChatClient instance using InitialChatbot
const chatClient = new ChatClient(initialChatbot);
// Step 3: Send messages using ChatClient
const messages = ["Hello!", "What's the weather today?", "Tell me a joke."];
for (const message of messages) {
const response = await chatClient.sendMessage(message);
console.log('Response:', response);
}
}
runExample();
Why Playwright?
Playwright is used in this project to capture the WP Nonce token from network requests. Capturing this token via fetch is challenging and complex, making Playwright a more suitable option for this task. If anyone can achieve this using fetch, contributions are highly appreciated.
Future Versions
In future versions, we plan to include a method for storing message history to enhance the functionality of the chatbot interactions.
Important Notes
- This is an unofficial tool for scraping GPT-4 using a free chatGPT4 website.
- This project is intended solely for learning and fun purposes.
- The author is not responsible for any illegal activities conducted by users of this tool.
Disclaimer
This project is for educational and fun purposes only. The author is not liable for any misuse of this tool. Users should not use this tool for any illegal activities. This tool is not for sale and not intended for commercial use.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to improve the functionality or address any bugs.
License
This project is licensed under the ISC License.
Contact
For any issues or questions, please visit the issues page.