#! /bin/bash set -e ## Initial setup. mkdir -p $MIRRORS/eprint-bib; cd $MIRRORS/eprint-bib eprint=http://eprint.iacr.org rm -f list tags ## Fetch the master index. curl -sS -o list -z '1 hour ago' $eprint/complete/ [ -r list ] || exit 0 ## Pick out the article tags. sed -n '/^.*$/ s::\1:p' list >tags ## For each tag, make sure we have the article information. while read tag; do dir=${tag%/*} mkdir -p $dir file=$dir/eprint-${tag/\//-}.bib [ -r $file ] || { curl -sS -o $file.in "$eprint/cgi-bin/cite.pl?entry=$tag" sed -n " /^
/,/<\/PRE>/ {
      /^
/ d
      s:
.*:: s%note =.*\$%url = {http://eprint.iacr.org/$tag},% p }" $file.in >$file.sed mv $file.sed $file rm -f $file.in echo $tag } done eprint.bib.new mv eprint.bib.new eprint.bib