From dd86138412dc4eb6c7d1ce61f3a3308b5ce85043 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 20 Jun 2017 15:34:36 +0200 Subject: Adding timestamp to script URL --- ranking.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranking.py b/ranking.py index 1b5f989..96bc3f8 100644 --- a/ranking.py +++ b/ranking.py @@ -1,4 +1,4 @@ -import copy, sys +import copy, os, sys from bs4 import BeautifulSoup as bs4 from pyranking.fetch import fetch_ranking @@ -57,6 +57,9 @@ for row in ranking: new_row['class'] = new_row.get('class', []) + ['info'] table_body.append(new_row) +script_src = table.select('script[src="res/ranking.js"]')[0] +script_src['src'] = '%s?%d' % ('res/ranking.js', os.path.getmtime('http/res/ranking.js')) + rawlink = table.select('a#rawlink')[0] rawlink['href'] = '%s/%s.csv' % (rawlink['href'], ranking_date) -- cgit v1.2.3