Skip to content

Instantly share code, notes, and snippets.

@jquave
Created December 15, 2016 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jquave/9c12ec71ead5852a9bd791b5fcc08c25 to your computer and use it in GitHub Desktop.
Save jquave/9c12ec71ead5852a9bd791b5fcc08c25 to your computer and use it in GitHub Desktop.
require 'date'
class WFGet
def self.current_quarter
yr = Date.today.year
if yr >=10
4
elsif yr >= 7
3
elsif yr >= 4
2
else
1
end
end
def self.todays_edgar_url
# Current quarter, 1 - 4
qtr_num = self.current_quarter
# Current year 2016 format
yr = Date.today.year
# Filename from date
filename = Date.today.strftime("%Y%m%d") + ".nc.tar.gz"
"https://www.sec.gov/Archives/edgar/Feed/#{yr}/QTR#{qtr_num}/#{filename}"
end
def self.get_todays_data
puts "WFGet::get_todays_data"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment