Created
November 2, 2017 00:25
-
-
Save tilacog/93c3bc97349a848326161d97a8ea3cef to your computer and use it in GitHub Desktop.
Download NFe XML files from Google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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