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

19 lines
672 B
Smalltalk

accessing
writeWordsFile
| rawTweets rawWords collectionsWords count |
self tweets ifNil: [ ^ self ].
rawTweets := self tweets tweets.
rawWords := OrderedCollection new.
collectionsWords := ((rawTweets select:
[ :tweet | tweet user userName = 'FranciaMarquezM' ])
collect: [ :tweet | (tweet words
reject: [ :w | w includesSubstring: 'nitter42lfr' ]) ]).
count := 1.
collectionsWords size timesRepeat: [
rawWords addAll: (collectionsWords at:count).
count := count + 1.].
rawWords := ' ' join:rawWords.
^ MarkupFile exportAsFileOn: (FileLocator userData / 'Socialmetrica' / self userName / self userName, 'words', 'txt') containing: rawWords.