Creating retweets and quotes sorted by occurrences.
This commit is contained in:
parent
e840f733fe
commit
cde55509bf
@ -3,7 +3,7 @@ exportRetweetsHistogram
|
||||
|
||||
| retweetsOccurrences labels retweetColor diagram x retweetsHistogram |
|
||||
|
||||
retweetsOccurrences := (self retweets messages collect: [ :tweet | tweet user userName ]) asBag contents asDictionary.
|
||||
retweetsOccurrences := self retweetsSortedByOccurrences.
|
||||
retweetColor := (Color r:(217/255) g:(56/255) b: (124/255)).
|
||||
x := 1 to: retweetsOccurrences size.
|
||||
retweetsHistogram := RSChart new.
|
||||
|
@ -0,0 +1,9 @@
|
||||
accessing
|
||||
quotesSortedByOccurrences
|
||||
|
||||
| response quotesUserOccurrences |
|
||||
quotesUserOccurrences := (self quotes messages collect: [ :tweet | ((tweet metadata at: 'quote') splitOn: '/') first ]) asBag contents asDictionary.
|
||||
response := OrderedDictionary new.
|
||||
(quotesUserOccurrences associations asSortedCollection: [:x :y | x value > y value])
|
||||
collect: [:assoc | response at: assoc key put:assoc value].
|
||||
^ response
|
@ -0,0 +1,9 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user