summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html_template/template.html12
-rw-r--r--unbiasedFunctions.py5
2 files changed, 10 insertions, 7 deletions
diff --git a/html_template/template.html b/html_template/template.html
index 393a862..94a3796 100644
--- a/html_template/template.html
+++ b/html_template/template.html
@@ -49,7 +49,7 @@
<div id="middle-stories">
- <a target="_blank" href="xxURL2-1xx" >
+ <a target="_blank" href="redirects/h2-1.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-1xx" />
@@ -58,7 +58,7 @@
</div>
</a>
- <a target="_blank" href="xxURL2-2xx" >
+ <a target="_blank" href="redirects/h2-2.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-2xx" />
@@ -67,7 +67,7 @@
</div>
</a>
- <a target="_blank" href="xxURL2-3xx" >
+ <a target="_blank" href="redirects/h2-3.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-3xx" />
@@ -77,7 +77,7 @@
</a>
- <a target="_blank" href="xxURL2-4xx" >
+ <a target="_blank" href="redirects/h2-4.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-4xx" />
@@ -86,7 +86,7 @@
</div>
</a>
- <a target="_blank" href="xxURL2-5xx" >
+ <a target="_blank" href="redirects/h2-5.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-5xx" />
@@ -95,7 +95,7 @@
</div>
</a>
- <a target="_blank" href="xxURL2-6xx" >
+ <a target="_blank" href="redirects/h2-6.html" >
<div class="middle-story">
<div class="middle-stories-img">
<img src="xxImg2-6xx" />
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py
index acce6a5..a67f800 100644
--- a/unbiasedFunctions.py
+++ b/unbiasedFunctions.py
@@ -165,7 +165,10 @@ def buildOutput(newsSourceArr):
source=newsSourceArr[h2RandomSources[i]]
randomArticle=random.sample(range(len(source.h2Arr)), 1)[0]
article=source.h2Arr[randomArticle]
- template=template.replace('xxURL2-'+str(i+1)+'xx', article.url)
+ #template=template.replace('xxURL2-'+str(i+1)+'xx', article.url)
+ r=open('/var/www/html/redirects/h2-'+str(i+1)+'.html', 'w')
+ r.write('<html><head><script type="text/javascript">window.location="'+article.url+'"</script></head></html>')
+ r.close()
template=template.replace('xxTitle2-'+str(i+1)+'xx', article.title)
template=template.replace('xxImg2-'+str(i+1)+'xx', article.img)