Added functionality for users to select news articles by topic.#36
Open
slryan09 wants to merge 1 commit intoGriffintaur:masterfrom
Open
Added functionality for users to select news articles by topic.#36slryan09 wants to merge 1 commit intoGriffintaur:masterfrom
slryan09 wants to merge 1 commit intoGriffintaur:masterfrom
Conversation
Griffintaur
reviewed
Oct 4, 2018
| __Limit=None | ||
| def __init__(self): | ||
| with open("config.yml", 'r') as ymlfile: | ||
| with open("/Users/Stormy/PycharmProjects/News-At-Command-Line/config.yml", 'r') as ymlfile: |
Owner
There was a problem hiding this comment.
This is not right. This path will not hold valid for every user. Thus not correct. The earlier one will search for config.yml in the present directory and make sure it is the relative path and not the full path..
Griffintaur
reviewed
Oct 4, 2018
| import sys | ||
|
|
||
| class NewsPulling(object): | ||
|
|
Griffintaur
reviewed
Oct 4, 2018
| # Pulls news stories based on SOURCE -- self.Source will indicate the correctly formatted | ||
| # news source to be included in the URL | ||
| def PullNews(self): | ||
|
|
Owner
There was a problem hiding this comment.
move the URL to the parameter of the class while stories or topic as input to the method based on which either it will fetch stories or topics. or if possible create an interface and then inherits different class both of which it will handle differently based on their use case.
Griffintaur
reviewed
Oct 4, 2018
| while True: | ||
| for i in xrange(len(newsTopics)): | ||
| print ("[" + str(i) + "]" + "\t" + newsTopics[i]) | ||
| print ("Please enter the index of the news topic") |
Owner
There was a problem hiding this comment.
move these print statement into some single function called disclaimer or anything that is intuitive.
Griffintaur
requested changes
Oct 4, 2018
| def TextExtractionAlgo(self,text,htmlelement,classname): | ||
| soup=BeautifulSoup(text,'html.parser') | ||
| title=soup.title.string | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added an additional option to let users choose to read the top stories based on category/topic. When they initially run the program, it will first ask whether they want to read articles based on topic or news source. If by news source, the program gives the original news source options to choose from. If by topic, the program gives a new menu to pick a topic.