2022-04-15 00:20:45 +00:00
|
|
|
accessing
|
2022-05-14 21:56:07 +00:00
|
|
|
installCommons
|
2022-04-15 00:20:45 +00:00
|
|
|
|
|
|
|
| commonFiles folder |
|
|
|
|
commonFiles := #(
|
2022-04-15 00:39:46 +00:00
|
|
|
'https://mutabit.com/repos.fossil/mutabit/uv/wiki/commons/nube-mascara.jpg'
|
2022-05-14 21:56:07 +00:00
|
|
|
'https://mutabit.com/repos.fossil/mutabit/raw?name=wiki/commons/stopwords-es.txt&ci=tip'
|
|
|
|
'https://mutabit.com/repos.fossil/mutabit/uv/wiki/commons/logo-mutabit-negro.png').
|
2022-04-15 00:20:45 +00:00
|
|
|
folder := TweetsCollection dataStore / 'commons'.
|
2022-04-15 01:00:06 +00:00
|
|
|
folder exists
|
|
|
|
ifTrue: [ folder ensureDeleteAllChildren ]
|
|
|
|
ifFalse: [ folder ensureCreateDirectory].
|
2022-04-15 00:20:45 +00:00
|
|
|
commonFiles do: [ :fileUrl |
|
|
|
|
ZnClient new
|
|
|
|
url: fileUrl;
|
2022-04-15 00:39:46 +00:00
|
|
|
downloadTo: folder].
|
2022-04-15 01:00:06 +00:00
|
|
|
(folder children detect: [ :file | file basename includesSubstring: 'raw' ])
|
2022-04-16 06:59:52 +00:00
|
|
|
renameTo: (((commonFiles second splitOn: 'raw?') second splitOn: '/') last removeSuffix: '&ci=tip').
|
|
|
|
^ folder
|
2022-04-15 00:20:45 +00:00
|
|
|
|