Commit a818444f authored by stew's avatar stew

import of 34c3vouchers

parents
#!/bin/bash
dst='/srv/hackt-im-stratum0.org/htdocs/34c3'
filename='s0vouchers.png'
function gendot(){
(echo "strict digraph S0SocialWeb{" ;
wget -q -O - https://pad.stratum0.org/p/34c3vouchers/export/txt |
awk '/\*Verlorene Voucher/{f=0};f{print tolower($0)};/\*Fertig und weitergegeben haben/{f=1;next}'|
sed -E -e "s/^\s*[0-9]+.\s+(\S+).*von\s+(\S+).*an\s+(\S+).*/\"\\1\" -> \"\\3\" \n\"\\2\" -> \"\\1\"/" |
sed -E -e "s/^\s*[0-9]+.\s+(\S+).*von (\S+).*/\"\\2\" -> \"\\1\"/" |
sed -E -e "s/^\s*[0-9]+.\s+(\S+).*an (\S+).*/\"\\1\" -> \"\\2\"/" |
sed -E -e "s/[.,'\)]//g" |
sed -E -s "s/(.*)\"xxx_(.*)_xxx\"(.*)/\\1 \"\\2\" \\3 \n\"\\2\" [shape=underline]/";
echo "}")
}
case $1 in
dot)
gendot
;;
saveimg)
gendot | dot -T png > $dst/$filename
;;
show)
gendot | dot -T gif | feh -
;;
*)
echo "Usage: $0 <saveimg|show>"
echo " saveimg - Save image"
echo " show - Shoe imahge"
;;
esac
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment