summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorssstvinc2 <sstvinc2@gmail.com>2017-02-11 17:47:00 -0500
committerssstvinc2 <sstvinc2@gmail.com>2017-02-11 17:47:00 -0500
commitbbb9c4de54cd3f8e20ab9cc891ea7db54669656d (patch)
tree614a32695e043e23d2ed927fafb0360e9e7f1738
parent2669db6a582c492c70645da53ec26cd1f9ef2cd9 (diff)
Added og:description text to top stories
-rwxr-xr-xhtml_template/template.html27
-rwxr-xr-xhtml_template/unbiased.css5
-rw-r--r--unbiasedFunctions.py10
3 files changed, 30 insertions, 12 deletions
diff --git a/html_template/template.html b/html_template/template.html
index 76b8681..071e1a4 100755
--- a/html_template/template.html
+++ b/html_template/template.html
@@ -16,32 +16,35 @@
<div id="page-container">
<div id="top-stories">
- <a target="_blank" href="xxURL1-1xx" id="top-story-1">
- <div class="top-story">
+ <div class="top-story">
+ <a target="_blank" href="xxURL1-1xx" id="top-story-1">
<div class="top-stories-img">
<img src="xxImg1-1xx" />
</div>
<div class="top-stories-hed">xxTitle1-1xx</div>
- </div>
- </a>
+ </a>
+ <div class="top-stories-desc">xxDesc1-1xx</div>
+ </div>
- <a target="_blank" href="xxURL1-2xx" id="top-story-2">
- <div class="top-story">
+ <div class="top-story">
+ <a target="_blank" href="xxURL1-2xx" id="top-story-2">
<div class="top-stories-img">
<img src="xxImg1-2xx" />
</div>
<div class="top-stories-hed">xxTitle1-2xx</div>
- </div>
- </a>
+ </a>
+ <div class="top-stories-desc">xxDesc1-2xx</div>
+ </div>
- <a target="_blank" href="xxURL1-3xx" id="top-story-3">
- <div class="top-story">
+ <div class="top-story">
+ <a target="_blank" href="xxURL1-3xx" id="top-story-3">
<div class="top-stories-img">
<img src="xxImg1-3xx" />
</div>
<div class="top-stories-hed">xxTitle1-3xx</div>
- </div>
- </a>
+ </a>
+ <div class="top-stories-desc">xxDesc1-3xx</div>
+ </div>
</div>
<div id="middle-stories">
diff --git a/html_template/unbiased.css b/html_template/unbiased.css
index d1b1460..564b6a7 100755
--- a/html_template/unbiased.css
+++ b/html_template/unbiased.css
@@ -59,6 +59,11 @@
vertical-align:text-bottom;
}
+.top-stories-desc{
+ font-size:.8em;
+ padding-top:.5em;
+}
+
#middle-stories{
clear:both;
width:1000px;
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py
index a2585e5..9a24ccf 100644
--- a/unbiasedFunctions.py
+++ b/unbiasedFunctions.py
@@ -191,6 +191,16 @@ def buildOutput(newsSourceArr):
template=template.replace('xxURL1-'+str(i+1)+'xx', article.url)
template=template.replace('xxTitle1-'+str(i+1)+'xx', article.title)
template=template.replace('xxImg1-'+str(i+1)+'xx', article.img)
+ desc=article.description
+ if len(desc)>144:
+ print(desc+'\n')
+ desc=desc[:141]
+ print(desc+'\n')
+ desc=desc.split()[:-1]
+ print(' '.join(desc)+'\n')
+ desc=' '.join(desc)+' ...'
+ print(desc+'\n')
+ template=template.replace('xxDesc1-'+str(i+1)+'xx', desc)
for i in range(len(h2RandomSources)):