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

9 lines
397 B
Smalltalk
Raw Normal View History

accessing
retweetsSortedByOccurrences
| response retweetsOccurrences |
retweetsOccurrences := (self retweets messages collect: [ :tweet | tweet user userName ]) asBag contents asDictionary.
response := OrderedDictionary new.
(retweetsOccurrences associations asSortedCollection: [:x :y | x value > y value])
collect: [:assoc | response at: assoc key put:assoc value].
^ response