summaryrefslogtreecommitdiff
path: root/unbiasedFunctions.py
diff options
context:
space:
mode:
Diffstat (limited to 'unbiasedFunctions.py')
-rw-r--r--unbiasedFunctions.py10
1 files changed, 10 insertions, 0 deletions
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)):