Last active
October 12, 2024 15:42
-
-
Save IsaacGemal/091b0720e1c0d7e3a5cde8c09c3f5602 to your computer and use it in GitHub Desktop.
Count your gpt conversatinos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let finalConversationCount = 0; | |
| async function scrollAndCountConversations() { | |
| let conversationContainer = document.querySelector('nav[aria-label="Chat history"]'); | |
| let previousCount = 0; | |
| let currentCount = 0; | |
| let maxElements = 100; // Limit to 100 elements for testing, increase as needed | |
| while (currentCount < maxElements) { | |
| let conversationList = document.querySelectorAll('li[data-testid^="history-item"]'); | |
| currentCount = conversationList.length; | |
| if (currentCount === previousCount) { | |
| break; | |
| } | |
| previousCount = currentCount; | |
| if (conversationList.length > 0) { | |
| conversationList[conversationList.length - 1].scrollIntoView({ behavior: 'smooth' }); | |
| } | |
| await new Promise(resolve => setTimeout(resolve, 5000)); // Slow so it doesn't break anything | |
| } | |
| finalConversationCount = currentCount; | |
| console.log(`You have had ${currentCount} conversations with GPT (limit: ${maxElements}).`); | |
| } | |
| scrollAndCountConversations(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment