Socialmetrica/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st

19 lines
694 B
Smalltalk
Raw Permalink Normal View History

accessing
installExternalWordCloudCommons
| commonFiles folder |
commonFiles := #(
'https://mutabit.com/repos.fossil/mutabit/uv/wiki/commons/nube-mascara.jpg'
'https://mutabit.com/repos.fossil/mutabit/raw?name=wiki/commons/stopwords-es.txt&ci=tip').
folder := TweetsCollection dataStore / 'commons'.
folder exists
ifTrue: [ folder ensureDeleteAllChildren ]
ifFalse: [ folder ensureCreateDirectory].
commonFiles do: [ :fileUrl |
ZnClient new
url: fileUrl;
downloadTo: folder].
(folder children detect: [ :file | file basename includesSubstring: 'raw' ])
renameTo: (((commonFiles second splitOn: 'raw?') second splitOn: '/') last removeSuffix: '&ci=tip').
^ folder