Creating nitter user as dictionary for web report and twwets by time span.
This commit is contained in:
parent
40d47caf1c
commit
c8e7509e6a
@ -0,0 +1,28 @@
|
|||||||
|
accessing
|
||||||
|
asDictionaryForWeb
|
||||||
|
|
||||||
|
| tweets tweetsHistogramData repliesHistogramData quotesHistogramData retweetsHistogramData |
|
||||||
|
tweets := self messages.
|
||||||
|
tweetsHistogramData := self tweetsByTimeSpan: 7.
|
||||||
|
repliesHistogramData := self repliesByWeeksTimeSpan.
|
||||||
|
quotesHistogramData := self quotesReportData.
|
||||||
|
retweetsHistogramData := self retweetsReportData.
|
||||||
|
|
||||||
|
^ { 'profile-card-avatar' -> self profileImageFile fullName.
|
||||||
|
'profile-card-avatar-url' -> self profileImageUrl.
|
||||||
|
'profile-card-fullname' -> self name .
|
||||||
|
'profile-card-username' -> self userName .
|
||||||
|
'profile-bio' -> self profileBio.
|
||||||
|
'messages-size' -> tweets size.
|
||||||
|
'messages-newest' -> tweets newest created asDate greaseString.
|
||||||
|
'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.
|
||||||
|
'retweets-histogram-labels' -> retweetsHistogramData third.
|
||||||
|
'retweets-histogram-quantity' -> retweetsHistogramData second.
|
||||||
|
'quotes-histogram-labels' -> quotesHistogramData third.
|
||||||
|
'quotes-histogram-quantity' -> quotesHistogramData second.
|
||||||
|
'wordcloud-data' -> self wordcloudData first.
|
||||||
|
} asDictionary
|
@ -0,0 +1,19 @@
|
|||||||
|
accessing
|
||||||
|
tweetsByTimeSpan: divisions
|
||||||
|
|
||||||
|
| tweetsByTimeSpan xAxis labels |
|
||||||
|
tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: divisions.
|
||||||
|
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), ']').
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user