MCPcopy Create free account
hub / github.com/deta/surf / useFallbackParser

Method useFallbackParser

packages/web-parser/src/index.ts:90–101  ·  view source on GitHub ↗
(document: Document)

Source from the content-addressed store, hash-verified

88 }
89
90 useFallbackParser(document: Document) {
91 const articleParser = new ArticleParser(this.url)
92
93 const isArticle = articleParser.isArticle(document)
94 console.log('Is article', isArticle)
95
96 if (isArticle) {
97 return articleParser
98 } else {
99 return new LinkParser(this.url)
100 }
101 }
102
103 createWebviewExtractor(document: Document) {
104 return new WebViewExtractor(this.url, document)

Callers 3

runAppDetectionFunction · 0.95

Calls 2

isArticleMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected