From c28bef137660867b64f72fa5c1b781de40ec26d6 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Tue, 16 Feb 2016 11:21:45 -0500 Subject: [PATCH] Update the readme to include a freshness date. --- readme_template.md | 5 ++++- updateHostsFile.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readme_template.md b/readme_template.md index b738fcc0d..c4e7e68d6 100644 --- a/readme_template.md +++ b/readme_template.md @@ -3,7 +3,10 @@ This repository consolidates several reputable `hosts` files, and merges them into a single amalgamated hosts file with duplicates removed. You can [download the resultant amalgamated hosts file](https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts) or clone this repo and generate your own using the Python script provided. -**Currently this amalgamated hosts file contains @NUM_ENTRIES@ unique entries.** +**Details about this amalgamated hosts file:** + +* Source data was updated, and the amalgamated hosts file was generated, on **@GEN_DATE@**. +* Currently this amalgamated hosts file contains **@NUM_ENTRIES@ unique entries**. ## Goals of this amalgamated hosts file diff --git a/updateHostsFile.py b/updateHostsFile.py index ee73fc1c7..654e0135c 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -333,6 +333,7 @@ def writeOpeningHeader(finalFile): def updateReadme(numberOfRules): with open(README_FILE, "wt") as out: for line in open(README_TEMPLATE): + line = line.replace( '@GEN_DATE@', time.strftime("%Y %B %d at %H:%M:%S +0000", time.gmtime())) out.write(line.replace('@NUM_ENTRIES@', "{:,}".format(numberOfRules))) def moveHostsFileIntoPlace(finalFile):