summaryrefslogtreecommitdiff
path: root/mkpdf
blob: ec6ca0a79d902ee1417e5bfaa40b87b5b41afb74 (plain)
  1. #!/bin/sh
  2. # fetch PDF text
  3. set -e
  4. # resolve options
  5. eval set -- "$(getopt -s sh -o f -- "$@")"
  6. while true; do case "$1" in -f) force=1; shift;; --) shift; break;; esac; done
  7. . /lib/lsb/init-functions
  8. # operate on both files if none provided
  9. test "$#" -gt 0 || eval set -- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  10. log_action_begin_msg "Fetch PDF"
  11. for stem in "$@"; do
  12. outfile=$stem.pdf
  13. log_action_cont_msg $stem
  14. [ -n "$force" ] || [ ! -f $outfile ] || [ $outfile -ot "$0" ] || { log_warning_msg "skipped"; continue; }
  15. case $stem in
  16. 1) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2009:078:0001:0042:en:PDF';;
  17. 2) wget -O$outfile 'http://www.europarl.europa.eu/registre/docs_autres_institutions/commission_europeenne/com/2013/0161/COM_COM%282013%290161_EN.pdf';;
  18. 3) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:52012PC0011:EN:PDF';;
  19. # disappeared 20130510
  20. # 4) wget -O$outfile 'http://www.statewatch.org/news/2013/may/eu-coe-data-protection-8825-13.pdf';;
  21. 4) wget -O$outfile 'http://erikjosefsson.eu/sites/default/files/Council-20130424-GDPR-statewatch-leak.pdf';;
  22. # the following 5 documents are ACTA leaks and the 6th is the final ACTA text
  23. 5) wget -O$outfile 'http://www.laquadrature.net/files/201001_acta.pdf';;
  24. 6) wget -O$outfile 'http://trade.ec.europa.eu/doclib/docs/2010/april/tradoc_146029.pdf';;
  25. 7) wget -O$outfile 'http://www.erikjosefsson.eu/sites/default/files/ACTA_leak_20100701.pdf';;
  26. 8) wget -O$outfile 'http://keionline.org/sites/default/files/acta_aug25_dc.pdf';;
  27. 9) wget -O$outfile 'http://keionline.org/sites/default/files/actaoct2010.pdf';;
  28. 10) wget -O$outfile 'http://trade.ec.europa.eu/doclib/docs/2011/may/tradoc_147937.pdf';;
  29. # the following 9 documents are EUR-LEX files, the first each year in the Offical Journal of the EU (OJ) starting 1996
  30. 11) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:1996:001:0001:001:en:PDF';;
  31. 12) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:1997:001:0001:001:en:PDF';;
  32. 13) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:1998:001:0001:001:en:PDF';;
  33. 14) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:1999:001:0001:001:en:PDF';;
  34. 15) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2000:001:0001:001:en:PDF';;
  35. 16) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2001:001:0001:001:en:PDF';;
  36. 17) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2002:001:0001:001:en:PDF';;
  37. 18) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:001:0001:001:en:PDF';;
  38. 19) wget -O$outfile 'http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2004:001:0001:001:en:PDF';;
  39. esac
  40. done
  41. log_action_end_msg $?