Created
December 8, 2014 08:07
-
-
Save kirillsulim/bf689865d474ea82c059 to your computer and use it in GitHub Desktop.
Generate html with all bash.im/abyssbest for last year (site restriction)
This file contains hidden or 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
numdays = 365 | |
base = datetime.datetime.today() | |
date_list = [base - datetime.timedelta(days=x) for x in range(1, numdays)] | |
file = open("da.html", "w+") | |
file.write("<html><body><div>") | |
for day in date_list: | |
dz = "http://bash.im/abyssbest/{0:04}{1:02}{2:02}".format(day.year, day.month, day.day) | |
file.write("<a href=" + dz + ">"+ dz + "</a><br>") | |
file.write("</div></body></html>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment