Creating replies and quotes static web report histogram.
This commit is contained in:
parent
c713ad9d28
commit
91744733bd
@ -1,9 +1,11 @@
|
||||
accessing
|
||||
asDictionary
|
||||
|
||||
| tweets tweetsHistogramData |
|
||||
| tweets tweetsHistogramData repliesHistogramData quotesHistogramData |
|
||||
tweets := self messages.
|
||||
tweetsHistogramData := self tweetsByWeeksTimeSpan.
|
||||
repliesHistogramData := self repliesByWeeksTimeSpan.
|
||||
quotesHistogramData := self quotesReportData.
|
||||
^ { 'profile-card-avatar' -> self profileImageFile fullName.
|
||||
'profile-card-avatar-url' -> self profileImageUrl.
|
||||
'profile-card-fullname' -> self name .
|
||||
@ -14,4 +16,8 @@ asDictionary
|
||||
'messages-oldest' -> tweets oldest created asDate greaseString.
|
||||
'tweets-histogram-labels' -> tweetsHistogramData third.
|
||||
'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
|
@ -5,7 +5,8 @@ installTemplate
|
||||
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/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 exists
|
||||
ifTrue: [ folder ensureDeleteAllChildren ]
|
||||
|
@ -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), ']').
|
||||
}
|
@ -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), ']').
|
||||
}
|
||||
|
@ -1,13 +1,8 @@
|
||||
accessing
|
||||
tweetsByWeeksTimeSpan
|
||||
|
||||
| weeks floor divisions tweetsByTimeSpan xAxis labels |
|
||||
weeks := ((self newestTweet created - self oldestTweet created) days / 7).
|
||||
floor := weeks floor.
|
||||
(weeks - floor) > 0.4
|
||||
ifTrue: [ divisions := floor ]
|
||||
ifFalse: [ divisions := floor + 1 ].
|
||||
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: divisions.
|
||||
| tweetsByTimeSpan xAxis labels |
|
||||
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: self tweetsDivisionsByWeeks.
|
||||
xAxis := OrderedCollection new.
|
||||
(tweetsByTimeSpan values collect: [ :collection | collection size ]) do: [ :number |
|
||||
xAxis add: ($' asString), (number asString), ($' asString)
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user