update adaption for reddit and gitlab

This commit is contained in:
josc146
2023-06-12 21:17:49 +08:00
parent 53e94fdd0c
commit 0fa19daa80
2 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -145,9 +145,9 @@ export const config = {
},
gitlab: {
inputQuery: gitlab.inputQuery,
sidebarContainerQuery: ['.js-commit-box-info'],
sidebarContainerQuery: ['.info-well', '.js-commit-box-info'],
appendContainerQuery: [],
resultsContainerQuery: ['.js-commit-box-info'],
resultsContainerQuery: ['.info-well', '.js-commit-box-info'],
},
zhihu: {
inputQuery: zhihu.inputQuery,
@@ -157,9 +157,9 @@ export const config = {
},
reddit: {
inputQuery: reddit.inputQuery,
sidebarContainerQuery: ['.side div:nth-child(2)'],
sidebarContainerQuery: ['#pdp-right-rail-topics div'],
appendContainerQuery: [],
resultsContainerQuery: ['.side div:nth-child(2)'],
resultsContainerQuery: ['#pdp-right-rail-topics div'],
},
quora: {
inputQuery: quora.inputQuery,
@@ -3,15 +3,15 @@ import { cropText } from '../../../utils'
export default {
inputQuery: async () => {
try {
const title = document.querySelector('.entry .title').textContent
const texts = document.querySelectorAll('.entry .usertext-body')
let description
if (texts.length > 0) description = texts[0].textContent
const title = document.querySelector('.main shreddit-post div:nth-child(4)').textContent
const description = document.querySelector(
'.main shreddit-post div:nth-child(6) div',
).textContent
const texts = document.querySelectorAll('shreddit-comment div:nth-child(2)')
let answers = ''
if (texts.length > 1)
for (let i = 1; i < texts.length; i++) {
answers += `answer${i}:${texts[i].textContent}|`
}
for (let i = 0; i < texts.length; i++) {
answers += `answer${i}:${texts[i].textContent}|`
}
return cropText(
`Below is the content from a social forum,giving the corresponding summary and your opinion on it.` +