GrafoscopioUtils/repository/Grafoscopio-Utils/LeDatabase.extension.st

12 lines
457 B
Smalltalk
Raw Normal View History

Extension { #name : #LeDatabase }
{ #category : #'*Grafoscopio-Utils-Core' }
LeDatabase >> detectLocalPageForRemote: markdeepDocUrl [
| markdeepHelper id remoteMetadata docTree |
markdeepHelper := Markdeep new.
docTree := (XMLHTMLParser on: markdeepDocUrl asUrl retrieveContents) parseDocument.
remoteMetadata := markdeepHelper metadataFromXML: docTree.
id := remoteMetadata at: 'id' ifAbsent: [ ^ false ].
^ self pageWithID: id ifAbsent: [ nil ].
]