diff options
author | emkael <emkael@tlen.pl> | 2017-06-20 15:34:36 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-06-20 15:34:36 +0200 |
commit | dd86138412dc4eb6c7d1ce61f3a3308b5ce85043 (patch) | |
tree | 91c93fc63e1ca49c346312f2f59d0be8744d9c9e | |
parent | d7056c28e49b73271e28400e1e88e707e54e6a89 (diff) |
Adding timestamp to script URL
-rw-r--r-- | ranking.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |