9 lines
397 B
Smalltalk
9 lines
397 B
Smalltalk
|
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
|