diff --git a/Socialmetrica.package/NitterUser.class/instance/exportRetweetsHistogram.st b/Socialmetrica.package/NitterUser.class/instance/exportRetweetsHistogram.st index 732ae5c..cf756f4 100644 --- a/Socialmetrica.package/NitterUser.class/instance/exportRetweetsHistogram.st +++ b/Socialmetrica.package/NitterUser.class/instance/exportRetweetsHistogram.st @@ -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. diff --git a/Socialmetrica.package/NitterUser.class/instance/quotesSortedByOccurrences.st b/Socialmetrica.package/NitterUser.class/instance/quotesSortedByOccurrences.st new file mode 100644 index 0000000..94e17a2 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/quotesSortedByOccurrences.st @@ -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 \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/retweetsSortedByOccurrences.st b/Socialmetrica.package/NitterUser.class/instance/retweetsSortedByOccurrences.st new file mode 100644 index 0000000..8c957c0 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/retweetsSortedByOccurrences.st @@ -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 \ No newline at end of file