diff --git a/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st b/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st new file mode 100644 index 0000000..94afa61 --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/exportTweetsHistogramWithBars..st @@ -0,0 +1,36 @@ +accessing +exportTweetsHistogramWithBars: aNumberOfBars + + | timeSpans labels tweetsByTimeSpan subtotals tweetsColor x tweetsHistogram diagram | + timeSpans := self tweets timeSpansOf: aNumberOfBars. + labels := (timeSpans collect: [ :timeSpan | + ((timeSpan start asDate asString removeSuffix: '2022'), '→ ', timeSpan end asDate asString removeSuffix: '2022') + ]) asArray. + tweetsByTimeSpan := OrderedCollection new. + 1 to: labels size do: [ :i | + tweetsByTimeSpan add: (self tweets messages select: [ :tweet | + (timeSpans at: i) includes: (tweet created asDateAndTime)]) + ]. + subtotals := tweetsByTimeSpan collect: [ :collection | collection size ]. + tweetsColor := (Color r:(91/255) g:(131/255) b:(222/255)). + x := 1 to: subtotals size. + tweetsHistogram := RSChart new. + tweetsHistogram extent: 800@200. + diagram := RSBarPlot new x: x y:subtotals. + diagram color: tweetsColor. + tweetsHistogram addPlot: diagram. + tweetsHistogram addDecoration: (RSHorizontalTick new + fromNames: labels; + labelRotation: 0; + fontSize: 80 /aNumberOfBars; + yourself). + tweetsHistogram addDecoration: (RSVerticalTick new + integer; + fontSize: 80 /aNumberOfBars). + tweetsHistogram build. + tweetsHistogram canvas pdfExporter + zoomToShapes; + noFixedShapes; + fileName: (self folder / 'trinos.pdf')fullName; + export. + ^ self folder / 'trinos.pdf' \ No newline at end of file diff --git a/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st b/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st index 2808555..4b81e02 100644 --- a/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st +++ b/Socialmetrica.package/NitterUser.class/instance/installExternalWordCloudCommons.st @@ -14,6 +14,6 @@ installExternalWordCloudCommons url: fileUrl; downloadTo: folder]. (folder children detect: [ :file | file basename includesSubstring: 'raw' ]) - renameTo: 'stopwords-es.txt'. - ^ folder + renameTo: (((commonFiles second splitOn: 'raw?') second splitOn: '/') last removeSuffix: '&ci=tip'). + ^ folder \ No newline at end of file