mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add parser
This commit is contained in:
parent
e3839647e1
commit
9431e80be8
2 changed files with 4 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { DOMWindow } from 'jsdom'
|
||||
|
||||
export class SubstackHandler {
|
||||
export class BloombergHandler {
|
||||
name = 'bloomberg'
|
||||
|
||||
shouldPrehandle = (url: URL, dom: DOMWindow): boolean => {
|
||||
|
|
@ -15,7 +15,7 @@ export class SubstackHandler {
|
|||
)
|
||||
}
|
||||
|
||||
prehandle = (url: URL, dom: DOMWindow): Promise<DOMWindow> => {
|
||||
prehandle = (_url: URL, dom: DOMWindow): Promise<DOMWindow> => {
|
||||
const body = dom.document.querySelector('.wrapper')
|
||||
|
||||
// this removes header
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import axios from 'axios'
|
|||
import { WikipediaHandler } from './wikipedia-handler'
|
||||
import { SubstackHandler } from './substack-handler'
|
||||
import { AxiosHandler } from './axios-handler'
|
||||
import { BloombergHandler } from './bloomberg-handler'
|
||||
|
||||
const logger = buildLogger('utils.parse')
|
||||
|
||||
|
|
@ -45,6 +46,7 @@ const HANDLERS = [
|
|||
new WikipediaHandler(),
|
||||
new SubstackHandler(),
|
||||
new AxiosHandler(),
|
||||
new BloombergHandler(),
|
||||
]
|
||||
|
||||
/** Hook that prevents DOMPurify from removing youtube iframes */
|
||||
|
|
|
|||
Loading…
Reference in a new issue