Creating replies and quotes static web report histogram.
This commit is contained in:
parent
c713ad9d28
commit
91744733bd
@ -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
|
@ -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 ]
|
||||||
|
@ -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
|
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)
|
||||||
|
@ -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