Git Product home page Git Product logo

mudima's People

Contributors

acoadmarmon avatar el3ngry avatar jteves avatar masonshuler avatar mmw125 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mudima's Issues

Article.get_source() has attribute 'dict' and not 'Source'

File "/Users/mshuler/Documents/MuDimA/server/news_fetcher_test.py", line 42, in test_get_top_headlines
self.assertEqual(self.top_headline.get_source().get_id(), "usa-today")
AttributeError: 'dict' object has no attribute 'get_id'

Error while parsing URL

Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/newspaper/parsers.py", line 54, in fromstring
cls.doc = lxml.html.fromstring(html)
File "/Library/Python/2.7/site-packages/lxml/html/init.py", line 706, in fromstring
doc = document_fromstring(html, parser=parser, base_url=base_url, **kw)
File "/Library/Python/2.7/site-packages/lxml/html/init.py", line 600, in document_fromstring
value = etree.fromstring(html, parser, **kw)
File "lxml.etree.pyx", line 3032, in lxml.etree.fromstring (src/lxml/lxml.etree.c:68121)
File "parser.pxi", line 1786, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:102470)
File "parser.pxi", line 1667, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:101229)
File "parser.pxi", line 1035, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:96139)
File "parser.pxi", line 582, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:91290)
File "parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:92476)
File "parser.pxi", line 631, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:91904)
XMLSyntaxError: line 396: Element script embeds close tag
You must download and parse an article before parsing it!

It seems like there is an issue with the article URLs. Not all URLs will be valid and they throw this specific error. I will look more into it before assigning a fix.

Get more user feedback.

Communicate with us on what to ask users. We want to know what is missing in the news sources today

OperationalError: table article has no column named date

When calling localhost/updateStories table is not updated because:

OperationalError: table article has no column named date

[2017-10-23 00:38:21,809] ERROR in app: Exception on /updateStories [GET]
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Python/2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Python/2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Library/Python/2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Python/2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "app.py", line 17, in update_stories
news_fetcher.update_database()
File "/Users/mshuler/Documents/MuDimA/server/news_fetcher.py", line 67, in update_database
database_writer.write_topics_to_database(grouped)
File "/Users/mshuler/Documents/MuDimA/server/database_writer.py", line 21, in write_topics_to_database
grouping.get_uuid()))
OperationalError: table article has no column named date
127.0.0.1 - - [23/Oct/2017 00:38:23] "GET /updateStories HTTP/1.0" 500 -

self.top_headline.get_source().get_id() not returning None when expected

news_fetcher.get_top_headlines() is reading from the following json

{
"source": {
"id": null,
"name": null
},
"author": null,
"title": null,
"description": null,
"url": null,
"urlToImage": null,
"publishedAt": null
},

  self.assertEqual(self.top_headline.get_source().get_id(), None)

E AssertionError: u'the-next-web' != None

classifier.group_articles returning abnormally long grouped lists of len > 417

_______________ RigerousClassifierTest.test_classifier_grouping ________________

self = <server.classifier_test.RigerousClassifierTest testMethod=test_classifier_grouping>

def test_classifier_grouping(self):
    self.concat_articles = self.hurricane_harvy_urls + self.tom_petty_urls + self.las_vegas_urls
  self.assertEqual(3, len(classifier.group_articles(self.concat_articles)))

E AssertionError: 3 != 418

server/classifier_test.py:49: AssertionError
__________________ FindURLErrorTest.test_keywordless_articles __________________

self = <server.classifier_test.FindURLErrorTest testMethod=test_keywordless_articles>

def test_keywordless_articles(self):
    """Tests that keywordless articles are put into a separate grouping."""
    articles = [models.Article(url="example.com", keywords=[]), models.Article(url="test.com", keywords=[])]
    articles.extend(test_utils.SIMILAR_ARTICLES)
    groups = classifier.group_articles(articles)
  self.assertEqual(2, len(groups))

E AssertionError: 2 != 418

server/classifier_test.py:67: AssertionError
_____________________ FindURLErrorTest.test_parsing_issue ______________________

self = <server.classifier_test.FindURLErrorTest testMethod=test_parsing_issue>

def test_parsing_issue(self):
  self.assertEqual(1, len(classifier.group_articles(self.url)))

E AssertionError: 1 != 417

server/classifier_test.py:58: AssertionError

Sanitize user upvotes

Find a way to track users on click of an article and enable them to have a reputation to be able to vote on the article. Maybe time spent on the article?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.