From 4341383a8c09f1e2eec9f09cf84838e8c0a102f6 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Thu, 14 Apr 2022 19:20:45 -0500 Subject: [PATCH] Modifying external word cloud parameters. --- .../instance/installExternalWordCloudCommons.st | 14 ++++++++++++++ .../NitterUser.class/instance/writeWordsFile.st | 6 +++--- .../{instance => class}/dataStore.st | 0 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st rename Socialmetrica.package/TweetsCollection.class/{instance => class}/dataStore.st (100%) diff --git a/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st b/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st new file mode 100644 index 0000000..29de8ad --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st @@ -0,0 +1,14 @@ +accessing +installExternalWordCloudCommons + + | commonFiles folder | + commonFiles := #( + 'https://mutabit.com/repos.fossil/mutabit/uv/wiki/commons/nube-mascara.jpg'. + 'http://mutabit.com/repos.fossil/mutabit/raw/tip?at=stopwords-es.txt'). + folder := TweetsCollection dataStore / 'commons'. + folder exists ifFalse: [ folder ensureCreateDirectory]. + commonFiles do: [ :fileUrl | + ZnClient new + url: fileUrl; + downloadTo: self folder parent / 'commons'.] + \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st b/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st index a981edf..2aac3b0 100644 --- a/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st +++ b/Socialmetrica.package/NitterUser.class/instance/writeWordsFile.st @@ -3,13 +3,13 @@ writeWordsFile | rawTweets rawWords collectionsWords count | self messages ifNil: [ ^ self ]. - rawTweets := self messages messages. + rawTweets := self tweets messages. rawWords := OrderedCollection new. collectionsWords := ((rawTweets select: - [ :tweet | tweet user userName = self userName ]) + [ :tweet | tweet authorId = self id ]) collect: [ :tweet | (tweet words - reject: [ :w | w includesSubstring: 'nitter42lfr' ]) ]). + reject: [ :w | w includesSubstring: self class nitterProvider ]) ]). collectionsWords do: [ :word | rawWords addAll: word ]. rawWords := ' ' join:rawWords. diff --git a/Socialmetrica.package/TweetsCollection.class/instance/dataStore.st b/Socialmetrica.package/TweetsCollection.class/class/dataStore.st similarity index 100% rename from Socialmetrica.package/TweetsCollection.class/instance/dataStore.st rename to Socialmetrica.package/TweetsCollection.class/class/dataStore.st