diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index 6964cf5..4162b2b 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -229,7 +229,16 @@ TiddlyWiki >> downloadHTML [ ] { #category : #accessing } -TiddlyWiki >> downloadJSONCache [ +TiddlyWiki >> downloadLink: v into: subfolder [ + | filePath fileName semiFilePath | + fileName := v asUrl segments last. + semiFilePath := subfolder , fileName. + filePath := (FileLocator temp / semiFilePath) fullName. + GtSubprocessWithInMemoryOutput new + shellCommand: 'curl -L -# ' , v , ' -o ' , filePath; + runAndWait; + stdout. + ^ FileLocator temp / semiFilePath ] { #category : #accessing } @@ -557,6 +566,11 @@ TiddlyWiki >> isInTiddlyHost [ ^ self remote host endsWith: 'tiddlyhost.com' ] +{ #category : #accessing } +TiddlyWiki >> jsonCache [ + self downloadLink: self tiddlersJSONUrl into: self folder. +] + { #category : #accessing } TiddlyWiki >> jsonFile [ ^ jsonFile ifNil: [ @@ -859,7 +873,7 @@ TiddlyWiki >> remoteTiddlersContentsString [ self isInTiddlyHost ifFalse: [ ^ self ]. jsonAddress := self remote asString, '/tiddlers.json'. ^ [jsonAddress asZnUrl retrieveContents] - onErrorDo: [ self downloadJSONCache ]. + onErrorDo: [ self jsonCache ]. ] { #category : #accessing }