summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsstvinc2 <sstvinc2@gmail.com>2017-02-12 21:45:13 -0600
committersstvinc2 <sstvinc2@gmail.com>2017-02-12 21:45:13 -0600
commit9e4ab3d644929d467e1f3de6f456508d03d4db15 (patch)
treec5834b83773498f731b9a4a17736bba95c4879f7
parent1289131d2300bd991a2a2308d2a9396364c3fb62 (diff)
Obfuscated h1 links
Added redirect files to the server. Main html template file now has static links to those files; those files are written with javascript redirect to actual articles.
-rw-r--r--[-rwxr-xr-x]html_template/Penguins.jpgbin777835 -> 777835 bytes
-rw-r--r--[-rwxr-xr-x]html_template/template.html6
-rw-r--r--[-rwxr-xr-x]html_template/unbiased.css5
-rw-r--r--[-rwxr-xr-x]main.py4
-rw-r--r--unbiasedFunctions.py5
5 files changed, 14 insertions, 6 deletions
diff --git a/html_template/Penguins.jpg b/html_template/Penguins.jpg
index 030ab8a..030ab8a 100755..100644
--- a/html_template/Penguins.jpg
+++ b/html_template/Penguins.jpg
Binary files differ
diff --git a/html_template/template.html b/html_template/template.html
index ead234e..393a862 100755..100644
--- a/html_template/template.html
+++ b/html_template/template.html
@@ -17,7 +17,7 @@
<div id="page-container">
<div id="top-stories">
<div class="top-story">
- <a target="_blank" href="xxURL1-1xx" id="top-story-1">
+ <a target="_blank" href="redirects/h1-1.html" id="top-story-1">
<div class="top-stories-img">
<img src="xxImg1-1xx" />
</div>
@@ -27,7 +27,7 @@
</div>
<div class="top-story">
- <a target="_blank" href="xxURL1-2xx" id="top-story-2">
+ <a target="_blank" href="redirects/h1-2.html" id="top-story-2">
<div class="top-stories-img">
<img src="xxImg1-2xx" />
</div>
@@ -37,7 +37,7 @@
</div>
<div class="top-story">
- <a target="_blank" href="xxURL1-3xx" id="top-story-3">
+ <a target="_blank" href="redirects/h1-3.html" id="top-story-3">
<div class="top-stories-img">
<img src="xxImg1-3xx" />
</div>
diff --git a/html_template/unbiased.css b/html_template/unbiased.css
index 564b6a7..ade390b 100755..100644
--- a/html_template/unbiased.css
+++ b/html_template/unbiased.css
@@ -1,3 +1,8 @@
+a:link, a:visited, a:hover, a:active {
+ color: #00f;
+ text-decoration:none;
+ }
+
#page-header{
text-align:center;
padding:.5em 0 1em;
diff --git a/main.py b/main.py
index 3d7b0ee..b18e6ce 100755..100644
--- a/main.py
+++ b/main.py
@@ -70,7 +70,7 @@ def run():
sourceList.append(NewsSource('New York Times',
'http://nytimes.com',
- ['<a href="'],#'<h1 class="story-heading"><a href="'],#['"b-column column', 'h2 class="story-heading"><a href="'],
+ ['<a href="'],
['<article class="story theme-summary"', '<a href="'],
['<hr class="single-rule"', 'article class="story theme-summary', 'h2 class="story-heading"><a href="'],
'<div class="b-column column">', '<!-- close photo-spot-region -->',
@@ -95,7 +95,7 @@ def run():
#build the output file HTML
outputHTML=buildOutput(newsSourceArr)
#print the output file HTML
- printOutputHTML(outputHTML, '/var/www/html/index.html')#'unbiased.html')
+ printOutputHTML(outputHTML, '/var/www/html/index.html')
if __name__=="__main__":
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py
index da224ae..acce6a5 100644
--- a/unbiasedFunctions.py
+++ b/unbiasedFunctions.py
@@ -147,7 +147,10 @@ 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