Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mefengl/chatgpt-utils
getSubmitButton, getTextarea, getRegenerateButton, getNewChatButton...
https://github.com/mefengl/chatgpt-utils
Last synced: 10 days ago
JSON representation
getSubmitButton, getTextarea, getRegenerateButton, getNewChatButton...
- Host: GitHub
- URL: https://github.com/mefengl/chatgpt-utils
- Owner: mefengl
- License: mit
- Created: 2023-03-14T10:31:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T16:35:42.000Z (over 1 year ago)
- Last Synced: 2024-10-30T10:15:36.495Z (about 2 months ago)
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatGPT Utils
[![AI Friendly](https://img.shields.io/badge/AI-Friendly-pink?style=for-the-badge)](https://github.com/mefengl/made-by-ai)
[![AI Assisted Maybe](https://img.shields.io/badge/AI%20Assisted-Maybe-yellow?style=for-the-badge)](https://github.com/mefengl/made-by-ai)
[![Commit Messages by AI](https://img.shields.io/badge/Commit%20Messages%20by-AI-green?style=for-the-badge)](https://github.com/mefengl/made-by-ai)## Notice
this repo has been put into `chatkit`, you can find more about it in [chat-play/packages/chatkit/chatgpt](https://github.com/mefengl/chat-play)
## Description
getSubmitButton, getTextarea, getRegenerateButton, getNewChatButton...
## Usage
just copy and paste the code below
```js
function getSubmitButton() {
const form = document.querySelector('form');
const buttons = form.querySelectorAll('button');
const result = buttons[buttons.length - 1];
return result;
};
``````js
function getTextarea() {
const form = document.querySelector('form');
const textareas = form.querySelectorAll('textarea');
const result = textareas[0];
return result;
};
``````js
function getRegenerateButton() {
const form = document.querySelector('form');
const buttons = form.querySelectorAll('button');
const result = Array.from(buttons).find(button => button.textContent.trim().toLowerCase().includes('regenerate'));
return result;
};
``````js
function getStopGeneratingButton() {
const form = document.querySelector('form');
const buttons = form.querySelectorAll('button');
return Array.from(buttons).find(button => button.textContent.trim().toLowerCase().includes('stop generating'));
}
``````js
function getNewChatButton() {
const aElements = document.getElementsByTagName('a');
const result = Array.from(aElements).find(a => a.textContent === 'New chat');
return result;
};
```## Contributing
Contributions, issues and feature requests are welcome!
## License
This project is licensed under the terms of the [MIT license](/LICENSE).