chatgpt-exporter
chatgpt-exporter copied to clipboard
Notate revision/resubmitted number
In ChatGPT, you can edit and resubmit sent messages to re-generate previous outputs. I suggest adding an indicator which revision a conversation displays if available.
Here is an example snippet from my own script for a concept of what I want added:
let Revision = '';
const revisionElement = message.querySelector(".text-xs .flex-grow");
if (revisionElement && revisionElement.innerHTML) {
Revision = `Edit Revision: **${revisionElement.innerHTML}**`;
}
So essentially, on ChatGPT the class .text-xs
is how I identify the chat segment has some sort of edit (unique to revision/resubmitted chat messages) and the class .flex-grow
while not unique is the child element that contains desired information.
Then I would append Revision (and if there are no edits it's an empty string anyways.)
`markdownContent += `**${sender}:** ${Revision}\n${messageText.trim()}\n\n`;`
So what do you think? I discovered this github today, I was previously using a self-created script in Chrome's console, but then I decided to check out if there was any userscripts as I grew tired of copy/pasting into F12. I tried to edit the javascript file myself, but honestly, trying to edit it in Notepad++ is annoying and the arrays and maps and nested functions just confused me, so I submitted a Feature Request on your github instead 😄
This is something doable. But I have a question about where and how to put this annotation. I have tried these:
#### You:
※ Revision: 2 / 2
If I want to generate a text file for both windows and *nix system, what ...
#### You:
If I want to generate a text file for both windows and *nix system, what ...
※ Revision: 2 / 2
#### You (2 /2):
If I want to generate a text file for both windows and *nix system, what ...
What do you think? I'm ok with adding this feature, but I want to make it nice and look good.
btw, this is the selector we currently use. And I would suggest you fork and edit the source code rather than working on the compiled script if you want, see CONTRIBUTING.
I would pick option 3 to match the style of how it's displayed on ChatGPT. I'll be honest, all the options you provided could be argued for or against. I also see an additional added bonus in that option 3 would likely add "sprinkles" to the monotonous and bland outline.
I have tried to implement this, but it will need some structural refactoring to expose the revision information. Give me a few days.