From 8678a915fa85773ed138342157ef5fa69b22aa74 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 10 Jan 2022 18:19:17 -0500 Subject: [PATCH] Reading tiddlers now from the HTML directly! (after 5.2.x series) --- repository/TiddlyWiki/TiddlyWiki.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index 79170e4..33175a9 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -98,6 +98,16 @@ TiddlyWiki >> fromDictionary: tiddlersDict [ wiki: self ]) ] +{ #category : #accessing } +TiddlyWiki >> fromUrl: anUrlString [ + | docTree rawJsonTiddlers tiddlersDictionary | + self remote: anUrlString. + docTree := XMLHTMLParser parse: (self remote retrieveContents). + rawJsonTiddlers := (docTree xpath: '//script[@class="tiddlywiki-tiddler-store"]') stringValue. + tiddlersDictionary := STONJSON fromString: rawJsonTiddlers. + self fromDictionary: tiddlersDictionary +] + { #category : #accessing } TiddlyWiki >> importJSONFile [