Skip to content

Commit

Permalink
feat(gemini): added word count
Browse files Browse the repository at this point in the history
  • Loading branch information
tschogge committed Nov 13, 2024
1 parent 6559822 commit 4f6469b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions websites/G/Gemini/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ presence.on("UpdateData", async () => {
case pathname.startsWith("/app"):
// Check the selected conversation
if (showTitle) {
presenceData.state = document.querySelector(
"div.conversation.selected>div.conversation-title"
).textContent ?? "Thinking of a new Prompt...";
}
presenceData.details = "Asking questions";
presenceData.details =
document.querySelector(
"div.conversation.selected>div.conversation-title"
).textContent ?? "Thinking of a new Prompt...";

// Show word count
const elem = document.querySelectorAll(
"p.query-text-line,div.response-optimization.markdown"
),
askedWOrds = elem[0].textContent.split(" ").length,

Check warning on line 31 in websites/G/Gemini/presence.ts

View workflow job for this annotation

GitHub Actions / Compile and Lint

Variable 'askedWOrds' is only used once
answerWords = elem[1].textContent.split(" ").length;

Check warning on line 32 in websites/G/Gemini/presence.ts

View workflow job for this annotation

GitHub Actions / Compile and Lint

Variable 'answerWords' is only used once
presenceData.state = `Asked ${askedWOrds} words | answered with ${answerWords} words.`;
} else
presenceData.details = "Asking questions";
break;
case pathname.startsWith("/extensions"):
presenceData.details = "Managing extensions";
Expand Down

0 comments on commit 4f6469b

Please sign in to comment.