mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 19:30:28 +08:00
update adaption for reddit and gitlab
This commit is contained in:
@@ -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.` +
|
||||
|
||||
Reference in New Issue
Block a user