Creating replies and quotes static web report histogram.

This commit is contained in:
ruidajo 2022-06-03 19:43:01 -05:00
parent c713ad9d28
commit 91744733bd
6 changed files with 55 additions and 10 deletions

View File

@ -1,9 +1,11 @@
accessing accessing
asDictionary asDictionary
| tweets tweetsHistogramData | | tweets tweetsHistogramData repliesHistogramData quotesHistogramData |
tweets := self messages. tweets := self messages.
tweetsHistogramData := self tweetsByWeeksTimeSpan. tweetsHistogramData := self tweetsByWeeksTimeSpan.
repliesHistogramData := self repliesByWeeksTimeSpan.
quotesHistogramData := self quotesReportData.
^ { 'profile-card-avatar' -> self profileImageFile fullName. ^ { 'profile-card-avatar' -> self profileImageFile fullName.
'profile-card-avatar-url' -> self profileImageUrl. 'profile-card-avatar-url' -> self profileImageUrl.
'profile-card-fullname' -> self name . 'profile-card-fullname' -> self name .
@ -14,4 +16,8 @@ asDictionary
'messages-oldest' -> tweets oldest created asDate greaseString. 'messages-oldest' -> tweets oldest created asDate greaseString.
'tweets-histogram-labels' -> tweetsHistogramData third. 'tweets-histogram-labels' -> tweetsHistogramData third.
'tweets-histogram-quantity' -> tweetsHistogramData second. 'tweets-histogram-quantity' -> tweetsHistogramData second.
'replies-histogram-labels' -> repliesHistogramData third.
'replies-histogram-quantity' -> repliesHistogramData second.
'quotes-histogram-labels' -> quotesHistogramData third.
'quotes-histogram-quantity' -> quotesHistogramData second.
} asDictionary } asDictionary

View File

@ -5,7 +5,8 @@ installTemplate
templateFiles := #( templateFiles := #(
'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/TwentySecondsCV/twentysecondcvMod.cls&ci=tip' 'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/TwentySecondsCV/twentysecondcvMod.cls&ci=tip'
'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/TwentySecondsCV/template.mus.tex&ci=tip' 'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/TwentySecondsCV/template.mus.tex&ci=tip'
'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/SarissaPersonalBlog/index.mus.html&ci=tip'). 'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/SarissaPersonalBlog/index.mus.html&ci=tip'
'https://mutabit.com/repos.fossil/mutabit/raw?name=plantillas/SarissaPersonalBlog/output.css&ci=tip').
folder := TweetsCollection dataStore / 'templates'. folder := TweetsCollection dataStore / 'templates'.
folder exists folder exists
ifTrue: [ folder ensureDeleteAllChildren ] ifTrue: [ folder ensureDeleteAllChildren ]

View File

@ -0,0 +1,14 @@
accessing
quotesReportData
| tempDict labels xAxis |
tempDict := self quotesSortedByOccurrences.
labels := tempDict keys.
labels := labels collect: [ :profile | ($' asString), '@', profile, ($' asString) ].
xAxis := tempDict values.
xAxis := xAxis collect: [ :value | ($' asString), (value asString), ($' asString) ].
^ {
tempDict.
('[', (',' join: xAxis), ']').
('[', (',' join: labels), ']').
}

View File

@ -0,0 +1,19 @@
accessing
repliesByWeeksTimeSpan
| tweetsByTimeSpan xAxis labels |
tweetsByTimeSpan := self collectMessages: [ self replies ] byTimeSpanSplits: self tweetsDivisionsByWeeks.
xAxis := OrderedCollection new.
(tweetsByTimeSpan values collect: [ :collection | collection size ]) do: [ :number |
xAxis add: ($' asString), (number asString), ($' asString)
].
labels := OrderedCollection new.
tweetsByTimeSpan keys do: [ :string |
labels add: ($' asString), string, ($' asString)
].
^ {
tweetsByTimeSpan.
('[', (',' join: xAxis), ']').
('[', (',' join: labels), ']').
}

View File

@ -1,20 +1,15 @@
accessing accessing
tweetsByWeeksTimeSpan tweetsByWeeksTimeSpan
| weeks floor divisions tweetsByTimeSpan xAxis labels | | tweetsByTimeSpan xAxis labels |
weeks := ((self newestTweet created - self oldestTweet created) days / 7). tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: self tweetsDivisionsByWeeks.
floor := weeks floor.
(weeks - floor) > 0.4
ifTrue: [ divisions := floor ]
ifFalse: [ divisions := floor + 1 ].
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: divisions.
xAxis := OrderedCollection new. xAxis := OrderedCollection new.
(tweetsByTimeSpan values collect: [ :collection | collection size ]) do: [ :number | (tweetsByTimeSpan values collect: [ :collection | collection size ]) do: [ :number |
xAxis add: ($' asString), (number asString), ($' asString) xAxis add: ($' asString), (number asString), ($' asString)
]. ].
labels := OrderedCollection new. labels := OrderedCollection new.
tweetsByTimeSpan keys do: [ :string | tweetsByTimeSpan keys do: [ :string |
labels add: ($' asString), string, ($' asString) labels add: ($' asString), string, ($' asString)
]. ].
^ { ^ {
tweetsByTimeSpan. tweetsByTimeSpan.

View File

@ -0,0 +1,10 @@
accessing
tweetsDivisionsByWeeks
| weeks floor divisions |
weeks := ((self newestTweet created - self oldestTweet created) days / 7).
floor := weeks floor.
(weeks - floor) > 0.4
ifTrue: [ divisions := floor ]
ifFalse: [ divisions := floor + 1 ].
^ divisions