diff options
Diffstat (limited to 'unbiasedFunctions.py')
-rw-r--r-- | unbiasedFunctions.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py index a67f800..c2f62c0 100644 --- a/unbiasedFunctions.py +++ b/unbiasedFunctions.py @@ -147,10 +147,12 @@ def buildOutput(newsSourceArr): source=newsSourceArr[h1RandomSources[i]]
randomArticle=random.sample(range(len(source.h1Arr)), 1)[0]
article=source.h1Arr[randomArticle]
- #template=template.replace('xxURL1-'+str(i+1)+'xx', article.url)
+ template=template.replace('xxURL1-'+str(i+1)+'xx', article.url)
+ '''
r=open('/var/www/html/redirects/h1-'+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('xxTitle1-'+str(i+1)+'xx', article.title)
template=template.replace('xxImg1-'+str(i+1)+'xx', article.img)
desc=article.description
@@ -165,10 +167,12 @@ 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)
|