Skip to content

Instantly share code, notes, and snippets.

@zunda
Last active February 6, 2023 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunda/469b1ec142bde7edaee2262d2294df58 to your computer and use it in GitHub Desktop.
Save zunda/469b1ec142bde7edaee2262d2294df58 to your computer and use it in GitHub Desktop.
Change in known accounts on a Mastodon server around November 2022
set xdata time
set timefmt "%Y-%m-%d %H:%M;%S"
set xrange ["2022-10-15":*]
set xlabel "UTC"
set ylabel "Accounts known to zundaon"
set grid
set term push
set term png small
set output "created_at.png"
plot "created_at.dat" using 1:0 with lines not
unset output
set term pop
set xdata time
set timefmt "%Y-%m-%d %H:%M"
set xrange [*:*]
set xlabel "UTC"
set format x "%Y-%m-%d"
set ylabel "New accounts known to zundaon/day"
set grid
set term push
set term png small
set output "daily-all.png"
plot "daily.dat" using 2:1 with impulses not
unset output
set term pop
set xdata time
set timefmt "%Y-%m-%d %H:%M"
set format x "%Y-%m-%d"
set xrange ["2022-10-13 12:00":"%ENDDATE% 12:00"]
set xlabel "UTC"
set ylabel "New accounts known to zundaon/day"
set grid
set term push
set term png small
set output "daily.png"
plot "daily.dat" using 2:1 with boxes not
unset output
set term pop
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S"
set xrange ["2023-01-28 00:00:01":*]
set xlabel "UTC"
set ylabel "Accounts known to zundaon"
set grid
set term push
set term png small
set output "gedan.png"
plot "created_at.dat" using 1:0 with lines not
unset output
set term pop
set xdata time
set timefmt "%Y-%m-%d %H:%M"
set xrange ["2022-10-13 11:30":"%ENDDATE%:30"]
set xlabel "UTC"
set ylabel "New accounts known to zundaon/hour"
set grid
set term push
set term png small
set output "hourly.png"
plot "hourly.dat" using 2:1 with boxes not
unset output
set term pop
default: created_at.png daily.png gedan.png daily-all.png updated_at.png hourly.png
created_at.txt:
heroku pg:psql -c "SELECT created_at,updated_at FROM accounts WHERE actor_type='Person';" -a zundan-mastodon > $@
created_at.dat: created_at.txt
awk '/[0-9][0-9]:[0-9][0-9]/{if($$1 > 2015 && $$1 < 2030){print $$1,$$2}}' $< | sort > $@
updated_at.dat: created_at.txt
awk '/[0-9][0-9]:[0-9][0-9]/{if($$4 > 2015 && $$4 < 2030){print $$4,$$5}}' $< | sort > $@
daily.dat: created_at.dat
awk '{print $$1}' $< | uniq -c | sed -e /`date -u +%Y-%m-%d`/d > $@
hourly.dat: updated_at.dat
awk -F: '{print $$1}' $< | uniq -c | sed -e "/`date -u +%Y-%m-%d\ %H`/d" > $@
daily.plot: daily.plot.in daily.dat
sed s/%ENDDATE%/`tail -1 daily.dat | awk '{print $$2}'`/ daily.plot.in > $@
hourly.plot: hourly.plot.in hourly.dat
sed "s/%ENDDATE%/`tail -1 hourly.dat | awk '{print $$2, $$3}'`/" hourly.plot.in > $@
created_at.png: created_at.dat created_at.plot
gnuplot created_at.plot
updated_at.png: updated_at.dat updated_at.plot
gnuplot updated_at.plot
daily.png: daily.dat daily.plot
gnuplot daily.plot
hourly.png: hourly.dat hourly.plot
gnuplot hourly.plot
daily-all.png: daily.dat daily-all.plot
gnuplot daily-all.plot
gedan.png: created_at.dat gedan.plot
gnuplot gedan.plot
clean:
-rm -f created_at.txt created_at.dat created_at.png daily.dat daily.png daily.plot gedan.png daily-all.png updated_at.png hourly.png hourly.plot
refresh:
@make clean default
set xdata time
set timefmt "%Y-%m-%d %H:%M;%S"
set xrange ["2022-10-15":*]
set xlabel "updated_at (UTC)"
set ylabel "Accounts known active to zundaon"
set grid
set term push
set term png small
set output "updated_at.png"
plot "updated_at.dat" using 1:0 with lines not
unset output
set term pop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment