Skip to content

Instantly share code, notes, and snippets.

@tilacog
Created November 2, 2017 00:25
Show Gist options
  • Save tilacog/93c3bc97349a848326161d97a8ea3cef to your computer and use it in GitHub Desktop.
Save tilacog/93c3bc97349a848326161d97a8ea3cef to your computer and use it in GitHub Desktop.
Download NFe XML files from Google
numsites=3
all: invoices
search-results.json:
googler --count ${numsites} --exact --noprompt 'intitle:”index of” nfe xml' --json > $@
sites.txt: search-results.json
< search-results.json jq ".[]|.url" | sed 's/"//g' > $@
invoices: sites.txt
wget --accept xml \
--directory-prefix $@ \
--input-file sites.txt \
--no-clobber \
--no-directories \
--no-parent \
--quiet \
--recursive \
make clean:
$(RM) search-results.json
$(RM) sites.txt
# rm -r invoices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment