mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-28 00:43:12 +08:00
implement arxiv adapter
This commit is contained in:
committed by
josc146
parent
487e1f88c2
commit
fb6b088f7a
@@ -279,6 +279,7 @@ export const defaultConfig = {
|
||||
'juejin',
|
||||
'mp.weixin.qq',
|
||||
'followin',
|
||||
'arxiv',
|
||||
],
|
||||
accessToken: '',
|
||||
tokenSavedOn: 0,
|
||||
@@ -330,6 +331,7 @@ export const defaultConfig = {
|
||||
'juejin',
|
||||
'mp.weixin.qq',
|
||||
'followin',
|
||||
'arxiv',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,18 @@
|
||||
//TODO
|
||||
import { cropText } from '../../../utils'
|
||||
|
||||
export default {
|
||||
inputQuery: async () => {
|
||||
try {
|
||||
const title = document.querySelector('.title')?.textContent.trim()
|
||||
const authors = document.querySelector('.authors')?.textContent
|
||||
const abstract = document.querySelector('blockquote.abstract')?.textContent.trim()
|
||||
|
||||
return await cropText(
|
||||
`Below is the paper abstract from a preprint site, summarize the key findings, methodology, and conclusions, especially highlight the contributions.` +
|
||||
`${title}\n${authors}\n${abstract}`,
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import weixin from './weixin'
|
||||
import followin from './followin'
|
||||
import duckduckgo from './duckduckgo'
|
||||
import brave from './brave'
|
||||
import arxiv from './arxiv'
|
||||
|
||||
/**
|
||||
* @typedef {object} SiteConfigAction
|
||||
@@ -208,4 +209,10 @@ export const config = {
|
||||
appendContainerQuery: [],
|
||||
resultsContainerQuery: ['#article-content', '#thead-gallery'],
|
||||
},
|
||||
arxiv: {
|
||||
inputQuery: arxiv.inputQuery,
|
||||
sidebarContainerQuery: ['.extra-services'],
|
||||
appendContainerQuery: [],
|
||||
resultsContainerQuery: ['.extra-services'],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user