Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/make -f
# Requires nokogiri & gnuplot
# curl | ./podcast-dow 1.png [title=hello]
plot = @nokogiri -e 'puts $$_.css("item pubdate").map{|n| Date.parse(n).strftime("%Y-%m-%d %u %a")}' | cat <(echo "$$script") - | gnuplot -e 'set term $1;' - > $@
%.png:; $(call plot,png)
%.svg:; $(call plot,svg)
export define script :=
set grid
set title "$(title)"
set xdata time
set timefmt "%Y-%m-%d"
set format x "%Y-%m"
set xtics rotate by 60 right
set yrange [0:8]
plot "-" using 1:2:ytic(3) with points pointtype 5 title ""
SHELL := /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment