Skip to content

Instantly share code, notes, and snippets.

@teabot
Created January 17, 2013 13:51
Show Gist options
  • Save teabot/4556023 to your computer and use it in GitHub Desktop.
Save teabot/4556023 to your computer and use it in GitHub Desktop.
A simple script for extracting some DOT from a wiki page and rendering as a PNG.
#!/bin/sh
curl -s "http://mywiki.me/wiki/DataFlow" > dataflow_page.html
awk '/# BEGIN/,/# END/{if(!/pattern/)print}' dataflow_page.html | \
awk '{gsub(">", ">", $0);print}' | \
awk '{gsub(""", "\"", $0);print}' | \
awk '{gsub("&lt;", "<", $0);print}' > dataflow.dot
EPOCH=`date +"%s"`
dot -Tpng dataflow.dot -o dataflow-${EPOCH}.png
gimp dataflow-${EPOCH}.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment