summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2017-06-02 11:34:43 -0400
committerGitHub <noreply@github.com>2017-06-02 11:34:43 -0400
commit0eaa69b2db5feb4095d09bf75d4123f960619e79 (patch)
tree4ee9a6c6047e9e9dc4a126e472756b0f9b529617 /main.py
parent0ac55bbafa02ad951c9f1708f1fbc7c8746d5fce (diff)
parenta82318fbdfc1af624fd9bf9bbae316ad45f43611 (diff)
Merge pull request #1 from sstvinc2/matt-refactor
Matt refactor
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/main.py b/main.py
deleted file mode 100755
index a109d2f..0000000
--- a/main.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python3
-
-from unbiasedObjects import *
-from unbiasedFunctions import *
-from parser import *
-import time
-
-
-def main():
- while True:
- print('-----------------------')
- run()
- print('-----------------------')
- time.sleep(600)
-
-def run():
- sourceList=[]
-
- '''
-
- SOURCES TO ADD NEXT:
- -ABC
- -REUTERS
- -Town Hall
-
- '''
-
-
- ### These values have to be the second half of the function name
- ### E.g. Guardian calls buildGuardian(), etc.
- sourceFnArr=['Guardian', 'TheHill', 'NPR', 'BBC', 'NBC', 'CBS',
- 'FoxNews', 'WashTimes', 'CSM', 'ABC'] #'Blaze'
-
- for source in sourceFnArr:
- tries=0
- while tries<3:
- try:
- fn='build'+source
- possibles = globals().copy()
- possibles.update(locals())
- method = possibles.get(fn)
- src=method()
- sourceList.append(src)
- break
- except:
- print('Build error. Looping again: '+source)
- tries+=1
- time.sleep(tries)
-
- #scrape all urls and build data structure
- newsSourceArr=buildNewsSourceArr(sourceList)
-
- #build the output file HTML
- outputHTML=buildOutput(newsSourceArr)
-
- #print the output file HTML
- printOutputHTML(outputHTML, '/var/www/html/index.html')
-
-
-if __name__=="__main__":
- main()