monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

feeds.sh (700B)


      1 #!/bin/sh
      2 
      3 BASEURL="http://blog.z3bra.org"
      4 
      5 test -z "$1" && echo "usage: `basename $0` <input file>" && exit 1
      6 
      7 cat << EOF
      8 <?xml version='1.0'?>
      9 <rss version='2.0'>
     10 <channel>
     11 <title>Monochromatic</title>
     12 <description>z3bra, the stripes appart</description>
     13 <link>http://blog.z3bra.org</link>
     14 EOF
     15 
     16 #sed -e "/^<!--/d" \
     17 #    -e "s/<[\/]\?[^<>]*>/\"/g" \
     18 #    -e "s/^## .*$/<description>/" \
     19 #    -e "s/^$/<\/description>\\n<\/item>/" \
     20 #    -e "s/^# \[\(.*\)\](\(.*\))/<item>\n<title>\1<\/title>\n<guid>\2<\/guid>/" \
     21 #    -e "s/<guid>/&http:\/\/blog.z3bra.org/" $1
     22 sed "s^\* [x0-9a-f]* - \[\(.*\)\](\(.*\))<item><title>\1</title><guid>$BASEURL\2</guid></item>" $1
     23 
     24 cat << EOF
     25 </channel>
     26 </rss>
     27 EOF