From bbb9c4de54cd3f8e20ab9cc891ea7db54669656d Mon Sep 17 00:00:00 2001 From: ssstvinc2 Date: Sat, 11 Feb 2017 17:47:00 -0500 Subject: Added og:description text to top stories --- html_template/template.html | 27 +++++++++++++++------------ html_template/unbiased.css | 5 +++++ unbiasedFunctions.py | 10 ++++++++++ 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 @@
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)): -- cgit v1.2.3