Skip to content

Instantly share code, notes, and snippets.

@mrcsparker
Created June 16, 2023 01:46
Show Gist options
  • Save mrcsparker/4cb6d0760eb46ee7e4f53f0a3c673d4c to your computer and use it in GitHub Desktop.
Save mrcsparker/4cb6d0760eb46ee7e4f53f0a3c673d4c to your computer and use it in GitHub Desktop.
require 'date'
Date.new(2019,10,1).upto(Date.today) do |date|
d = date.strftime("%y%m%d")
url = "https://fsapps.fiscal.treasury.gov/dts/files/#{d}00.xlsx"
unless File.exist? "data/#{d}.xlsx"
cmd = "curl '#{url}' --output data/#{d}.xlsx"
p cmd
`#{cmd}`
end
end%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment