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

Method createAppParser

packages/web-parser/src/index.ts:78–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 createAppParser() {
79 const hostname = this.url.hostname
80 const app = SUPPORTED_APPS.find((app) => app.matchHostname.test(hostname))
81
82 if (!app) return null
83
84 const Parser = ParserModules[app.id as keyof typeof ParserModules]
85 if (!Parser) return null
86
87 return new Parser(app, this.url) as WebAppExtractor
88 }
89
90 useFallbackParser(document: Document) {
91 const articleParser = new ArticleParser(this.url)

Callers 3

getPageInfoMethod · 0.95
getAppParserMethod · 0.95
runAppDetectionFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected