From 8d9a66e0125a7df22837b51b40516be93d16967a Mon Sep 17 00:00:00 2001 From: ruidajo Date: Wed, 8 Jun 2022 17:26:29 -0500 Subject: [PATCH] Creating week report contract and Modifying tweets histogram for empty tweets. --- .../instance/exportTweetsHistogramWithBars..st | 12 ++++++++++++ .../instance/exportWeekReportLatexBeginningAt..st | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Socialmetrica.package/NitterUser.class/instance/exportWeekReportLatexBeginningAt..st diff --git a/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st b/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st index 90402fc..9178baf 100644 --- a/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st +++ b/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st @@ -3,6 +3,18 @@ exportTweetsHistogramWithBars: aNumberOfBars | tweetsByTimeSpan subtotals tweetsHistogram diagram | + self tweets ifEmpty: [ + tweetsHistogram := RSChart new. + tweetsHistogram extent: 800@200. + tweetsHistogram build. + tweetsHistogram canvas pdfExporter + zoomToShapes; + noFixedShapes; + fileName: (self folder / 'tweets-histogram.pdf')fullName; + export. + ^ {self. 'self tweets is empty'} + ]. + tweetsByTimeSpan := self collectMessages: [ self tweets] byTimeSpanSplits: aNumberOfBars. subtotals := tweetsByTimeSpan values collect: [ :collection | collection size ]. tweetsHistogram := RSChart new. diff --git a/Socialmetrica.package/NitterUser.class/instance/exportWeekReportLatexBeginningAt..st b/Socialmetrica.package/NitterUser.class/instance/exportWeekReportLatexBeginningAt..st new file mode 100644 index 0000000..bb63ad9 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/exportWeekReportLatexBeginningAt..st @@ -0,0 +1,11 @@ +accessing +exportWeekReportLatexBeginningAt: aDay + + self config + at: 'reportingPeriod' + put: (Timespan starting: aDay asDateAndTime ending: ( aDay asDateAndTime + 7 days)). + self messages: self messages. + self + exportDefaultReport; + externalWordCloud. + ^ self folder \ No newline at end of file