Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/make -f
# Requires nokogiri & gnuplot
#
# curl http://feeds.5by5.tv/b2w | ./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 ""
endef
.DELETE_ON_ERROR:
SHELL := /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment