Skip to content

Conversation

@slryan09
Copy link

@slryan09 slryan09 commented Jun 6, 2018

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.

__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:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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..

import sys

class NewsPulling(object):

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraline

# Pulls news stories based on SOURCE -- self.Source will indicate the correctly formatted
# news source to be included in the URL
def PullNews(self):

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

while True:
for i in xrange(len(newsTopics)):
print ("[" + str(i) + "]" + "\t" + newsTopics[i])
print ("Please enter the index of the news topic")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these print statement into some single function called disclaimer or anything that is intuitive.

@Griffintaur Griffintaur self-requested a review October 4, 2018 12:16
def TextExtractionAlgo(self,text,htmlelement,classname):
soup=BeautifulSoup(text,'html.parser')
title=soup.title.string

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants