Skip to content

Commit

Permalink
Updated 2010 data fetching script to work gracefully if embargo has e…
Browse files Browse the repository at this point in the history
…nded.
  • Loading branch information
cgroskopf committed Jun 16, 2011
1 parent ccb79b4 commit 40b642b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dataprocessing/fetch_sf_data_2010.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ STATE_NAME=$1
STATE_NAME_LOWER=$2
STATE_NAME_ABBR=$3

CENSUS_DOMAIN="https://www.census.gov/embargo/pio"
EMBARGO_DOMAIN="https://www.census.gov/embargo/pio"
CENSUS_DOMAIN="http://www2.census.gov/census_2010/04-Summary_File_1/"

cd data

# 2010
wget $CENSUS_DOMAIN/${STATE_NAME}/${STATE_NAME_ABBR}2010.sf1.zip --user $CENSUS_USER --password $CENSUS_PASS
wget $EMBARGO_DOMAIN/${STATE_NAME}/${STATE_NAME_ABBR}2010.sf1.zip --user $CENSUS_USER --password $CENSUS_PASS

if [ ! -f ${STATE_NAME_ABBR}2010.sf1.zip ]
then
wget $CENSUS_DOMAIN/${STATE_NAME}/${STATE_NAME_ABBR}2010.sf1.zip --user $CENSUS_USER --password $CENSUS_PASS
fi

unzip ${STATE_NAME_ABBR}2010.sf1.zip

# Generate headers
Expand Down

0 comments on commit 40b642b

Please sign in to comment.