GET / { echo "text/html" > @fifo:response/header/Content-Type cat > @fifo:response/body <<-HTML
Add me to your bookmarks! HTML } GET /save/magnet { set -x link=@value:request/param/link [ -z $link ] && echo 400 > @fifo:response/status && exit 0 watch_folder=/tmp cd $watch_folder [[ "$link" =~ xt=urn:btih:([^&/]+) ]] || exit; echo "d10:magnet-uri${#link}:${link}e" > "meta-${BASH_REMATCH[1]}.torrent" echo 302 > @fifo:response/status echo "/torrent/list" > @fifo:response/header/Location } GET /torrent/list { echo "..." > @fifo:response/body }