diff --git a/ExtractMainContent.pyc b/ExtractMainContent.pyc new file mode 100644 index 0000000..b4cf892 Binary files /dev/null and b/ExtractMainContent.pyc differ diff --git a/Extractor.pyc b/Extractor.pyc new file mode 100644 index 0000000..bc0ddfb Binary files /dev/null and b/Extractor.pyc differ diff --git "a/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" "b/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" new file mode 100644 index 0000000..975133c --- /dev/null +++ "b/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" @@ -0,0 +1,26 @@ + +Legendary entertainer and civil rights activist Harry Belafonte used his final public appearance to issue a warning about the future of the nation. +According to The Guardian, Belafonte, 90, said “the country made a mistake” when it elected Donald Trump as president.  + + + +“I think the next mistake might very well be the gas chamber and what happened to Jews [under] Hitler is not too far from our door,” he was quoted as saying.  +Belafonte gave a wide-ranging talk at the Carnegie Music Hall in Pittsburgh on Friday about his life, his music and his decades-long fight for social justice. + + + + +He also sounded an optimistic note.   + + + +“We have achieved a lot in my lifetime,” Belafonte said, per The Guardian. “Dr. King was not about nothing. Eleanor Roosevelt was not about nothing. I think in the final analysis that we shall overcome because what we did is … we left a harvest that generations to come [will] reap. That they have not yet plowed. That they have not yet harvested.” + + + + + + + +Belafonte was the first African American to win an Emmy Award. “The King of Calypso” was also the recipient of several Grammys as well as a Tony. In 2014, he received the honorary Jean Hersholt Humanitarian Award at the Academy Awards.  +A member of the audience posted an audio recording of the Pittsburgh event:  diff --git a/Main.py b/Main.py index bea51da..ca4a494 100644 --- a/Main.py +++ b/Main.py @@ -9,6 +9,7 @@ from ExtractMainContent import ExtractMainContent import sys import codecs +from lazyme.string import color_print def NewsSources(): @@ -19,39 +20,40 @@ def App(): newsSources=NewsSources() while True: for i in xrange(len(newsSources)): - print ("["+str(i)+"]" +"\t" +newsSources[i]) - print ("Please enter the index of the news source or press 99 to quit") + color_print ("["+str(i)+"]" +"\t" +newsSources[i],color='yellow') + color_print ("Please enter the index of the news source or press 99 to quit", color='red') try: - newsSourceNumber=raw_input("News Source Number >>>> ") + color_print("News Source Number >>>> ",color="red") + newsSourceNumber=raw_input() except ValueError: - print ("That is not a valid News Source Number") + color_print ("That is not a valid News Source Number", color='red') newsSourceNumber=int(newsSourceNumber) if newsSourceNumber==99: sys.exit() if (newsSourceNumber >=len(newsSources)): - print ("Please select the index no less than "+ str(len(newsSources))) + color_print ("Please select the index no less than "+ str(len(newsSources)), color='red') obj=NewsPulling(newsSources[newsSourceNumber]) Articles=obj.BeautifyArticles(); while True: - print ("Do you want to read any story further? If yes, please select the number corresponding to the article") - print ("Press 66 to go back to the main menu") - print ("Press 99 to quit") + color_print ("Do you want to read any story further? If yes, please select the number corresponding to the article", color='red') + color_print ("Press 66 to go back to the main menu", color='red') + color_print ("Press 99 to quit", color='red') try: articleNumber=raw_input("Article No >>>> ") except ValueError: - print ("That is not a valid Article Number") + color_print ("That is not a valid Article Number", color='red') articleNumber=int(articleNumber) if articleNumber==99 : sys.exit() elif articleNumber==66 : break elif (articleNumber >= len(Articles)): - print ("Please select the index no less than "+ str(len(Articles))) - #print Articles[articleNumber][2] + color_print ("Please select the index no less than "+ str(len(Articles)), color='red') + #color_print Articles[articleNumber][2] else: extr=ExtractMainContent(newsSources[newsSourceNumber],Articles[articleNumber][2]) extr.Beautify() - print ("Do you want to save this article in file") + color_print ("Do you want to save this article in file", color='red') YesorNo = int(raw_input("Press 1 to save else press 0 to continue >>> ")) if YesorNo == 1: extr.FileSave() diff --git a/NewsPulling.py b/NewsPulling.py index 0b5e3e5..df497c9 100644 --- a/NewsPulling.py +++ b/NewsPulling.py @@ -9,6 +9,7 @@ from configReader import ConfigurationReader from requests import ConnectionError import sys +from lazyme.string import color_print class NewsPulling(object): """This class is used to pull news from the internet depending on the source specified """ @@ -73,9 +74,9 @@ def BeautifyArticles(self): if self.Articles is None or len(self.Articles)==0: print "No articles found" sys.exit() - print "=================STORIES==================================" + color_print("=================STORIES==================================",color='cyan') for i in xrange(len(self.Articles)): - print "[" +str(i) +"]", + color_print("[" +str(i) +"]",color='yellow') # print(sequence,end='') used for python 3.x if self.Articles[i][1] is not None: print "\t"+self.Articles[i][1] @@ -85,7 +86,7 @@ def BeautifyArticles(self): print "\t"+self.Articles[i][4] if self.Articles[i][3] is not None: print "\t"+self.Articles[i][3]+"\n" - print "***************************************************************" + color_print("***************************************************************",color='cyan') return self.Articles diff --git a/NewsPulling.pyc b/NewsPulling.pyc new file mode 100644 index 0000000..74d9311 Binary files /dev/null and b/NewsPulling.pyc differ diff --git a/configReader.pyc b/configReader.pyc new file mode 100644 index 0000000..e9dddb0 Binary files /dev/null and b/configReader.pyc differ