-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 加了一个ReadButton, 把GPT输出的文本转换为语音朗读出来 * add new adapter: followin * 适配长推文,调整列表边距 --------- Co-authored-by: Petaflops <[email protected]>
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { cropText } from '../../../utils' | ||
|
||
export default { | ||
inputQuery: async () => { | ||
try { | ||
const author = document.querySelector('main article a > span')?.textContent | ||
const description = | ||
document.querySelector('#article-content')?.textContent || | ||
document.querySelector('#thead-gallery')?.textContent | ||
if (author && description) { | ||
const title = document.querySelector('main article h1')?.textContent | ||
if (title) { | ||
return await cropText( | ||
`以下是一篇文章,请给出文章的结论和3到5个要点.标题是:"${title}",作者是:"${author}",内容是:\n"${description}". | ||
`, | ||
) | ||
} else { | ||
return await cropText( | ||
`以下是一篇长推文,请给出文章的结论和3到5个要点.作者是:"${author}",内容是:\n"${description}". | ||
`, | ||
) | ||
} | ||
} | ||
} catch (e) { | ||
console.log(e) | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters