summaryrefslogtreecommitdiff
path: root/unbiasedFunctions.py
diff options
context:
space:
mode:
authorssstvinc2 <sstvinc2@gmail.com>2017-02-09 20:24:25 -0500
committerssstvinc2 <sstvinc2@gmail.com>2017-02-09 20:24:25 -0500
commitcbbd1122c78834b1beef349797d142ed6d23218a (patch)
tree2afab3496e02cc1744e413d82ce509a25e3465f1 /unbiasedFunctions.py
parent439b2cf7317af9444e99ba58188d7ce80a906af5 (diff)
Added/tweaked a few news sources, and added a source list to the page
Diffstat (limited to 'unbiasedFunctions.py')
-rw-r--r--unbiasedFunctions.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py
index 84b4ec9..fc6f45b 100644
--- a/unbiasedFunctions.py
+++ b/unbiasedFunctions.py
@@ -86,8 +86,6 @@ def extractURLs(content, source):
h1=source.url+h1
h1s.append(h1)
-
-
h2=content
if source.h2SectionDividerStart!=None:
h2=h2.split(source.h2SectionDividerStart, 1)[1]
@@ -198,7 +196,13 @@ def buildOutput(newsSourceArr):
template=template.replace('xxTitle2-'+str(i+1)+'xx', article.title)
template=template.replace('xxImg2-'+str(i+1)+'xx', article.img)
-
+ sourcesStr=''
+ for i in range(len(newsSourceArr)-1):
+ sourcesStr+=newsSourceArr[i].name+', '
+ sourcesStr+=newsSourceArr[-1].name
+ print(sourcesStr)
+ template=template.replace('xxSourcesxx', sourcesStr)
+
#return updated text
return template