summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-06-20 15:34:36 +0200
committeremkael <emkael@tlen.pl>2017-06-20 15:34:36 +0200
commitdd86138412dc4eb6c7d1ce61f3a3308b5ce85043 (patch)
tree91c93fc63e1ca49c346312f2f59d0be8744d9c9e
parentd7056c28e49b73271e28400e1e88e707e54e6a89 (diff)
Adding timestamp to script URL
-rw-r--r--ranking.py5
1 files changed, 4 insertions, 1 deletions
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)