### Start Development Server with PNPM Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/CONTRIBUTING.md Starts the development server for the project using PNPM. This command is used after installing dependencies to enable local development and testing. It typically launches a local server or watch process. ```bash pnpm dev ``` -------------------------------- ### ChatGPT Exporter User Script Installation Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_FR.md Instructions for installing the ChatGPT Exporter user script. This involves installing the Tampermonkey browser extension, available for Chrome, Firefox, and Edge. Users can then install the script directly from Greasyfork or by linking to the GitHub repository. ```bash Install Tampermonkey browser extension (Chrome, Firefox, Edge). Install the ChatGPT Exporter script from Greasyfork or GitHub. ``` -------------------------------- ### Install Dependencies with PNPM Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/CONTRIBUTING.md Installs project dependencies using PNPM. Ensure PNPM is installed globally before running this command. This is a crucial step for setting up the development environment. ```bash pnpm install ``` -------------------------------- ### Example Text Export from ChatGPT Exporter Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_TR.md This example demonstrates the text output format generated by the ChatGPT Exporter script. It shows a conversation between 'You' and 'ChatGPT', highlighting how the script captures and formats chat messages for export. ```text Siz: ChatGPT Exporter oluşturuyorum. Ne düşünüyorsunuz? ChatGPT: ChatGPT modelini kullanarak metin dışa aktaran bir araç oluşturmayı planladığınızı düşünüyorum. ChatGPT, OpenAI tarafından eğitilen büyük bir dil modelidir ve verilen bir girişe dayanarak insan benzeri metin yanıtları üretmek için tasarlanmıştır. ChatGPT, sohbet botları, müşteri sorularına otomatik yanıtlar ve daha fazlası gibi çeşitli uygulamalar için kullanılabilir. Ancak, lütfen unutmayın ki büyük bir dil modeli olarak, ChatGPT herhangi bir belirli görev için özel olarak eğitilmemiştir, bu nedenle üretilen metinlerin kalitesi, nasıl kullanıldığına ve hangi bağlamda uygulandığına bağlı olacaktır. ChatGPT'yi sorumlu bir şekilde kullanmak ve herhangi bir durumda kullanmanın olası sonuçlarını düşünmek önemlidir. ``` -------------------------------- ### Example Text Export from ChatGPT Exporter Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_FR.md Demonstrates the text output format of the ChatGPT Exporter script. It shows a conversation between a user and ChatGPT, highlighting the structure of the exported text. ```text Vous : Je crée un ChatGPT Exporter. Qu'en pensez-vous ? ChatGPT : On dirait que vous prévoyez de créer un outil qui utilise le modèle ChatGPT pour exporter du texte. ChatGPT est un grand modèle de langage entraîné par OpenAI qui est conçu pour générer des réponses textuelles semblables à des réponses humaines à partir d'une entrée donnée. Il peut être utilisé pour Diverses applications, telles que des chatbots, des réponses automatisées aux demandes des clients, et plus encore. Cependant, gardez à l'esprit qu'en tant que grand modèle de langage, ChatGPT n'a pas été spécifiquement entraîné pour une tâche précise, la qualité du texte généré dépendra donc de son utilisation et du contexte dans lequel il est appliqué. Il est important d'utiliser ChatGPT de manière responsable et de considérer les conséquences potentielles de son utilisation dans n'importe quelle situation. ``` -------------------------------- ### Install ChatGPT Exporter UserScript from GitHub Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_TR.md This snippet provides a direct link to install the ChatGPT Exporter userscript from GitHub. It requires a browser extension like Tampermonkey to function. The script enables the export of ChatGPT chat history. ```bash https://raw.githubusercontent.com/pionxzh/chatgpt-exporter/master/dist/chatgpt.user.js ``` -------------------------------- ### Initialize Syntax Highlighting and Math Rendering in JavaScript Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/src/template.html This JavaScript snippet initializes syntax highlighting using hljs.highlightAll() and renders mathematical expressions using renderMathInElement. It includes event listeners for DOMContentLoaded and specific styling for KaTeX elements within paragraphs. ```javascript hljs.highlightAll() document.addEventListener("DOMContentLoaded", function() { renderMathInElement(document.body, { delimiters: [ { left: "$$", right: "$$", display: true }, { left: "$", right: "$", display: false }, { left: "\\[", right: "\\]", display: true }, { left: "\\(", right: "\\)", display: false } ], throwOnError: false, ignoredClasses: ["no-katex"], preProcess: function(math) { return `\\displaystyle \\Large ${math}`; } }); document.querySelectorAll('.katex').forEach(function(el) { const parent = el.parentNode; const grandparent = parent.parentNode; if (grandparent.tagName === 'P' && isOnlyContent(grandparent, parent)) { el.style.width = '100%'; el.style.display = 'block'; el.style.textAlign = 'center'; parent.style.textAlign = 'center'; } else { el.style.display = 'inline-block'; el.style.width = 'fit-content'; } }); function isOnlyContent(parent, element) { let onlyKaTeX = true; parent.childNodes.forEach(function(child) { console.log(child.textContent); if (child !== element) { if (child.nodeType === Node.TEXT_NODE) { if (child.textContent.trim().length > 0) { onlyKaTeX = false; } } else if (child.nodeType === Node.ELEMENT_NODE) { onlyKaTeX = false; } } }); return onlyKaTeX; } }); ``` -------------------------------- ### Initialize Theme and Width from URL (JavaScript) Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/src/template.html Reads 'theme' and 'width' parameters from the current URL using URLSearchParams and applies them using the respective toggle functions. It also sets up event listeners for UI elements to trigger these toggle functions. ```javascript const urlParams = new URLSearchParams(window.location.search); const theme = urlParams.get('theme'); const width = urlParams.get('width'); if (theme) toggleDarkMode(theme); if (width) toggleWidthMode(width); document.querySelector('.toggle').addEventListener('click', () => toggleDarkMode()); document.querySelector('.width-toggle').addEventListener('click', () => toggleWidthMode()); ``` -------------------------------- ### Run Linting and Testing with PNPM Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/CONTRIBUTING.md Executes linting and testing scripts defined in the project's package.json, managed by PNPM. Linting checks code style and potential errors, while testing verifies functionality. These commands ensure code quality before submission. ```bash pnpm run lint pnpm run test ``` -------------------------------- ### CSS Variables for Theming Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/src/template.html This CSS code defines CSS variables for light and dark themes, controlling text color, background color, border colors, and link colors. It also includes styles for scrollbars and elements like toggles and metadata containers. ```css :root { --page-text: #0d0d0d; --page-bg: #fff; --td-borders: #374151; --th-borders: #4b5563; --tw-prose-code: var(--page-text); --tw-prose-counters: #9b9b9b; --tw-prose-headings: var(--page-text); --tw-prose-hr: rgba(0,0,0,.25); --tw-prose-links: var(--page-text); --tw-prose-quotes: var(--page-text); --meta-title: #616c77; } [data-theme="dark"] { --page-text: #ececec; --page-bg: #212121; --tw-prose-code: var(--page-text); --tw-prose-counters: #9b9b9b; --tw-prose-headings: var(--page-text); --tw-prose-hr: hsla(0,0%,100%,.25); --tw-prose-links: var(--page-text); --tw-prose-quotes: var(--page-text); --meta-title: #959faa; } * { box-sizing: border-box; font-size: 16px; } ::-webkit-scrollbar { height: 1rem; width: .5rem } ::-webkit-scrollbar:horizontal { height: .5rem; width: 1rem } ::-webkit-scrollbar-track { background-color: transparent; border-radius: 9999px } ::-webkit-scrollbar-thumb { --tw-border-opacity: 1; background-color: rgba(217,217,227,.8); border-color: rgba(255,255,255,var(--tw-border-opacity)); border-radius: 9999px; border-width: 1px } ::-webkit-scrollbar-thumb:hover { --tw-bg-opacity: 1; background-color: rgba(236,236,241,var(--tw-bg-opacity)) } .dark ::-webkit-scrollbar-thumb { --tw-bg-opacity: 1; background-color: rgba(86,88,105,var(--tw-bg-opacity)) } .dark ::-webkit-scrollbar-thumb:hover { --tw-bg-opacity: 1; background-color: rgba(172,172,190,var(--tw-bg-opacity)) } @media (min-width: 768px) { .scrollbar-trigger ::-webkit-scrollbar-thumb { visibility:hidden } .scrollbar-trigger:hover ::-webkit-scrollbar-thumb { visibility: visible } } body { font-family: Söhne,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Helvetica Neue,Arial,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji; font-size: 14px; line-height: 1.5; color: var(--page-text); background-color: var(--page-bg); margin: 0; padding: 0; } [data-theme="light"] .sun { display: none; } [data-theme="dark"] .moon { display: none; } .toggle { display: inline-flex; justify-content: center; align-items: center; width: 32px; height: 32px; border-radius: 4px; background-color: #fff; border: 1px solid #e2e8f0; } [data-width="narrow"] .width-toggle .expand { display: block; } [data-width="wide"] .width-toggle .narrow { display: block; } .width-toggle { display: inline-flex; justify-content: center; align-items: center; width: 32px; height: 32px; border-radius: 4px; background-color: #fff; border: 1px solid #e2e8f0; margin-left: 8px; cursor: pointer; } .width-toggle svg { display: none; } .metadata_container { display: flex; flex-direction: column; margin-top: 8px; padding-left: 1rem; } .metadata_item { display: flex; flex-direction: row; align-items: center; border-radius: 16px; padding: 4px 0.5rem; } .metadata_item:hover { background-color: rgba(0,0,0,.1); } .metadata_item > div:first-child { flex: 0 1 100px; color: var(--meta-title); } .metadata_item > div:last-child { flex: 1; } a { color: var(--tw-prose-links); font-size: 0.8rem; text-decoration-line: underline; text-underline-offset: 2px; } .conversation-content > p:first-child, ol:first-child { margin-top: 0; } p>code, li>code { color: var(--tw-prose-code); font-weight: 600; font-size: .875em; } p>code::before, p>code::after, li>code::before, li>code::after { content: "`"; } hr { width: 100%; height: 0; border: 1px solid var(--tw-prose-hr); margin-bottom: 1em; margin-top: 1em; } pre { color: #ffffff; background-color: #000000; overflow-x: auto; margin: 0 0 1rem 0; border-radius: 0.375rem; } pre>code { font-family: Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace !important; font-weight: 400; font-size: .875em; line-height: 1.7142857; } h1, h2, h3, h4, h5, h6 { color: var(--tw-pros ``` -------------------------------- ### Toggle Dark Mode (JavaScript) Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/src/template.html Manages the website's dark mode by manipulating the 'data-theme' attribute on the 'html' element and updating URL search parameters. It accepts an optional 'mode' argument ('dark' or 'light') to set the theme, defaulting to the opposite of the current theme if not provided. ```javascript function toggleDarkMode(mode) { const html = document.querySelector('html'); const isDarkMode = html.getAttribute('data-theme') === 'dark'; const newMode = mode || (isDarkMode ? 'light' : 'dark'); if (newMode !== 'dark' && newMode !== 'light') return; html.setAttribute('data-theme', newMode); const url = new URL(window.location); url.searchParams.set('theme', newMode); window.history.replaceState({}, '', url); } ``` -------------------------------- ### Export ChatGPT Conversations to Markdown Format Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_KR.md This code snippet shows how to export ChatGPT conversations into Markdown format. It includes metadata such as title, source URL, and author, followed by the conversation content clearly delineated into 'You:' and 'ChatGPT:' sections. This format is ideal for integrating into documentation or notes. ```markdown --- title: ChatGPT Exporter Creation source: https://chat.openai.com/c/cf3f8850-1d69-43c8-b99b-affd0de4e76f author: ChatGPT --- # ChatGPT Exporter Creation #### You: ChatGPT Exporter 를 만들고 있어요. 어떻게 생각하세요? #### ChatGPT: ChatGPT Exporter 를 만들 계획이신 것 같군요. ChatGPT 는 OpenAI 에서 학습한 대규모 언어 모델로서, 주어진 입력에 기반하여 인간과 유사한 텍스트 응답을 생성하는 데 사용됩니다. 이는 챗봇, 고객 문의에 대한 자동 응답 등 다양한 응용 분야에서 활용될 수 있습니다. 하지만 대규모 언어 모델인 ChatGPT는 특정 작업을 위해 특별히 훈련된 것은 아니기 때문에 생성된 텍스트의 품질은 사용 방식과 적용되는 문맥에 따라 달라집니다. ChatGPT 를 책임있게 사용하고 해당 상황에서의 잠재적인 결과를 고려하는 것이 중요합니다. ``` -------------------------------- ### Export ChatGPT Chat History to Text Format Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README.md This code snippet demonstrates how to export ChatGPT chat history into a plain text format. It includes user prompts and ChatGPT's responses, formatted for readability. No specific dependencies are mentioned beyond the script's core functionality. ```plaintext You: I'm creating a ChatGPT Exporter. What do you think? ChatGPT: It sounds like you're planning on creating a tool that uses the ChatGPT model to export text. ChatGPT is a large language model trained by OpenAI that is designed to generate human-like text responses based on a given input. It can be used for a variety of applications, such as chatbots, automated responses to customer inquiries, and more. However, please keep in mind that as a large language model, ChatGPT has not been specifically trained for any specific task, so the quality of the generated text will depend on how it is used and the context in which it is applied. It's important to use ChatGPT responsibly and consider the potential consequences of using it in any given situation. ``` -------------------------------- ### Toggle Content Width (JavaScript) Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/src/template.html Controls the content width of the page by toggling the 'data-width' attribute on the 'body' element between 'wide' and 'narrow'. It also updates URL search parameters and toggles icons for visual feedback. The function accepts an optional 'mode' argument, defaulting to the opposite of the current width mode. ```javascript function toggleWidthMode(mode) { const body = document.querySelector('body'); const widthToggleButton = document.querySelector('.width-toggle'); const isWide = body.getAttribute('data-width') === 'wide'; const newWidthMode = mode || (isWide ? 'narrow' : 'wide'); if (newWidthMode !== 'narrow' && newWidthMode !== 'wide') return; body.setAttribute('data-width', newWidthMode); const url = new URL(window.location); url.searchParams.set('width', newWidthMode); window.history.replaceState({}, '', url); // Update the icon based on the current mode const narrowIcon = widthToggleButton.querySelector('.narrow'); const expandIcon = widthToggleButton.querySelector('.expand'); if (newWidthMode === 'wide') { expandIcon.style.display = "none"; narrowIcon.style.display = "block"; } else { expandIcon.style.display = "block"; narrowIcon.style.display = "none"; } } ``` -------------------------------- ### ChatGPT API Raw JSON Conversation Structure Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_ID.md This JSON object represents a raw response from the ChatGPT API for a specific conversation. It includes metadata about the conversation, a mapping of messages with their authors, content, and temporal relationships. The structure allows for reconstructing the turn-by-turn flow of a chat. ```json { "id": "35a1fa05-e928-4c39-8ffa-ca74f75b509f", "title": "AI Turing Test.", "create_time": 1678015311.655875, "mapping": { "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358": { "id": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "message": { "id": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "author": { "role": "system", "metadata": {} }, "create_time": 1678015311.655875, "content": { "content_type": "text", "parts": [ "" ] }, "end_turn": true, "weight": 1, "metadata": {}, "recipient": "all" }, "parent": "9310b90f-d8f0-4be6-bac2-daacddac784f", "children": [ "4afb9720-3a88-49b1-9309-e2b53d607f34" ] }, "9310b90f-d8f0-4be6-bac2-daacddac784f": { "id": "9310b90f-d8f0-4be6-bac2-daacddac784f", "children": [ "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358" ] }, "4afb9720-3a88-49b1-9309-e2b53d607f34": { "id": "4afb9720-3a88-49b1-9309-e2b53d607f34", "message": { "id": "4afb9720-3a88-49b1-9309-e2b53d607f34", "author": { "role": "user", "metadata": {} }, "create_time": 1678015311.656259, "content": { "content_type": "text", "parts": [ "write an poem about the Turing test" ] }, "weight": 1, "metadata": { "timestamp_": "absolute" }, "recipient": "all" }, "parent": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "children": [ "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1" ] }, "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1": { "id": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1", "message": { "id": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1", "author": { "role": "assistant", "metadata": {} }, "create_time": 1678185638.890551, "content": { "content_type": "text", "parts": [ "In the realm of machines and code,\nThere lies a test, with rules bestowed,\nA challenge to determine true mind,\nAnd if a machine's intelligence can find.\n\nThe Turing test, named for its creator,\nSeeks to find if a machine's behavior\nCan mimic that of a human so well,\nThat it's indistinguishable, can you tell?\n\nThrough conversations, the test is done,\nWith a judge and a machine, the game is run,\nIf the judge can't tell who is who,\nThen the machine's intelligence shines through.\n\nBut can a machine truly think?\nOr is it just a clever bit of link,\nBetween algorithms and programming code,\nCan it truly understand and decode?\n\nThe Turing test, a thought experiment,\nBrings up questions, doubts, and sentiment,\nFor as we strive to create machines smart,\nWe wonder, will they ever truly have heart?\n\nSo let us ponder and explore,\nAs we create machines more and more,\nThe Turing test a reminder to be,\nMindful of what our machines can truly see." ] }, "end_turn": false, "weight": 1, "metadata": { "model_slug": "text-davinci-002-render-sha", "finish_details": { "type": "stop" }, "timestamp_": "absolute" }, "recipient": "all" }, "parent": "4afb9720-3a88-49b1-9309-e2b53d607f34", "children": [] } }, "moderation_results": [], "current_node": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1" } ``` -------------------------------- ### Export ChatGPT Conversations to Text Format Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README_KR.md This code snippet demonstrates how to export ChatGPT conversations into a plain text format. It includes the user's input and the AI's response, formatted clearly for readability. This format is useful for simple archiving or sharing conversation content. ```plaintext 너: ChatGPT Exporter 를 만들고 있어요. 어떻게 생각하세요? ChatGPT: ChatGPT Exporter 를 만들 계획이신 것 같군요. ChatGPT 는 OpenAI 에서 학습한 대규모 언어 모델로서, 주어진 입력에 기반하여 인간과 유사한 텍스트 응답을 생성하는 데 사용됩니다. 이는 챗봇, 고객 문의에 대한 자동 응답 등 다양한 응용 분야에서 활용될 수 있습니다. 하지만 대규모 언어 모델인 ChatGPT는 특정 작업을 위해 특별히 훈련된 것은 아니기 때문에 생성된 텍스트의 품질은 사용 방식과 적용되는 문맥에 따라 달라집니다. ChatGPT 를 책임있게 사용하고 해당 상황에서의 잠재적인 결과를 고려하는 것이 중요합니다. ``` -------------------------------- ### ChatGPT API Conversation JSON Structure Source: https://github.com/pionxzh/chatgpt-exporter/blob/master/README.md The raw JSON content from the ChatGPT API endpoint. It includes conversation metadata, a mapping of message IDs to their respective details, and hierarchical relationships between messages. This structure is essential for understanding and processing chat history. ```json { "id": "35a1fa05-e928-4c39-8ffa-ca74f75b509f", "title": "AI Turing Test.", "create_time": 1678015311.655875, "mapping": { "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358": { "id": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "message": { "id": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "author": { "role": "system", "metadata": {} }, "create_time": 1678015311.655875, "content": { "content_type": "text", "parts": [ "" ] }, "end_turn": true, "weight": 1, "metadata": {}, "recipient": "all" }, "parent": "9310b90f-d8f0-4be6-bac2-daacddac784f", "children": [ "4afb9720-3a88-49b1-9309-e2b53d607f34" ] }, "9310b90f-d8f0-4be6-bac2-daacddac784f": { "id": "9310b90f-d8f0-4be6-bac2-daacddac784f", "children": [ "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358" ] }, "4afb9720-3a88-49b1-9309-e2b53d607f34": { "id": "4afb9720-3a88-49b1-9309-e2b53d607f34", "message": { "id": "4afb9720-3a88-49b1-9309-e2b53d607f34", "author": { "role": "user", "metadata": {} }, "create_time": 1678015311.656259, "content": { "content_type": "text", "parts": [ "write an poem about the Turing test" ] }, "weight": 1, "metadata": { "timestamp_": "absolute" }, "recipient": "all" }, "parent": "5c48fa3e-e4ee-4d00-aa66-8fbcb671a358", "children": [ "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1" ] }, "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1": { "id": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1", "message": { "id": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1", "author": { "role": "assistant", "metadata": {} }, "create_time": 1678185638.890551, "content": { "content_type": "text", "parts": [ "In the realm of machines and code,\nThere lies a test, with rules bestowed,\nA challenge to determine true mind,\nAnd if a machine's intelligence can find.\n\nThe Turing test, named for its creator,\nSeeks to find if a machine's behavior\nCan mimic that of a human so well,\nThat it's indistinguishable, can you tell?\n\nThrough conversations, the test is done,\nWith a judge and a machine, the game is run,\nIf the judge can't tell who is who,\nThen the machine's intelligence shines through.\n\nBut can a machine truly think?\nOr is it just a clever bit of link,\nBetween algorithms and programming code,\nCan it truly understand and decode?\n\nThe Turing test, a thought experiment,\nBrings up questions, doubts, and sentiment,\nFor as we strive to create machines smart,\nWe wonder, will they ever truly have heart?\n\nSo let us ponder and explore,\nAs we create machines more and more,\nThe Turing test a reminder to be,\nMindful of what our machines can truly see." ] }, "end_turn": false, "weight": 1, "metadata": { "model_slug": "text-davinci-002-render-sha", "finish_details": { "type": "stop" }, "timestamp_": "absolute" }, "recipient": "all" }, "parent": "4afb9720-3a88-49b1-9309-e2b53d607f34", "children": [] } }, "moderation_results": [], "current_node": "7027f1a5-8bd5-4463-9869-8a1d1db2f9a1" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.