Skip to content

Commit

Permalink
update adaption for reddit (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 4, 2024
1 parent 1fc3cd8 commit 4a25b03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/content-script/site-adapters/index.mjs
Expand Up @@ -170,9 +170,9 @@ export const config = {
},
reddit: {
inputQuery: reddit.inputQuery,
sidebarContainerQuery: ['#pdp-right-rail-topics div'],
sidebarContainerQuery: ['aside > div'],
appendContainerQuery: [],
resultsContainerQuery: ['#pdp-right-rail-topics div'],
resultsContainerQuery: ['aside > div'],
},
quora: {
inputQuery: quora.inputQuery,
Expand Down
6 changes: 3 additions & 3 deletions src/content-script/site-adapters/reddit/index.mjs
Expand Up @@ -3,11 +3,11 @@ import { cropText } from '../../../utils'
export default {
inputQuery: async () => {
try {
const title = document.querySelector('.main shreddit-post div:nth-child(4)').textContent
const title = document.querySelector('[id*="post-title"]').textContent
const description = document.querySelector(
'.main shreddit-post div:nth-child(6) div',
'shreddit-post > div.text-neutral-content',
).textContent
const texts = document.querySelectorAll('shreddit-comment div:nth-child(2)')
const texts = document.querySelectorAll('shreddit-comment div.md')
let answers = ''
for (let i = 0; i < texts.length; i++) {
answers += `answer${i}:${texts[i].textContent}|`
Expand Down

0 comments on commit 4a25b03

Please sign in to comment.