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

18 lines
649 B
Smalltalk
Raw Normal View History

2022-04-05 21:39:07 +00:00
accessing
writeWordsFile
"TO DO: Debug Tweet words to work better with Urls"
| rawTweets rawWords collectionsWords count |
2022-04-14 22:40:41 +00:00
self messages ifNil: [ ^ self ].
rawTweets := self tweets messages.
rawWords := OrderedCollection new.
collectionsWords := ((rawTweets select:
[ :tweet | tweet authorId = self id ])
collect: [ :tweet | (tweet words
reject: [ :w |
w includesSubstring:
((self class nitterProvider asUrl host copyWithoutAll: '.'))]) ]).
2022-04-06 18:09:38 +00:00
collectionsWords do: [ :word | rawWords addAll: word ].
rawWords := ' ' join:rawWords.
2022-04-06 18:09:38 +00:00
^ MarkupFile exportAsFileOn: (self folder / 'words', 'txt') containing: rawWords.