Dgmoddate.sh

From Data-gov Wiki

Jump to: navigation, search
Infobox (Technology) edit with form
  • name: Dgmoddate.sh

  • description: Shell script to obtain the Last-Modified date for the CSV hosted by data.gov.
  • creator(s): Tim Lebo
  • modified: 2010-4-9


#!/bin/sh

if [ $# -lt 1 ]; then
   echo "usage: `basename $0` dataset-id [dataset-id ...]"
fi

if [ $# -gt 1 ]; then
   printBoth=1
fi

while [ $# -gt 0 ]; do
  
   modDate=`curl -s -I -L http://www.data.gov/download/$1/csv | grep "Last-Modified:" | awk '{printf("%s-%s-%s\n",$3,$4,$5)}' 2> /dev/null`
   if [ $printBoth ]; then
      echo $1 $modDate
   else
      echo $modDate
   fi 
   shift 
done
Facts about Dgmoddate.shRDF feed
Dcterms:creatorTim Lebo  +
Dcterms:descriptionShell script to obtain the Last-Modified date for the CSV hosted by data.gov.
Dcterms:modified2010-4-9
Foaf:nameDgmoddate.sh
Skos:altLabelDgmoddate.sh  +, dgmoddate.sh  +, and DGMODDATE.SH  +
Personal tools
internal pages