ndarville / newsdiffs

Automatic scraper that tracks changes in news articles over time.
Other
1 stars 0 forks source link

Basic template in Danish, without legacy parsers #3

Open ndarville opened 10 years ago

ndarville commented 10 years ago

Steps

__init__.py:

parsers = """
inform.InformationParser
dr.DRParser
jp.JPParser
tv2.TV2Parser
b.BerlingskeParser
""".split()

models.py:

PublicationDict = {
    "www.information.dk": "Information",
    "www.dr.dk": "DR",
    "jyllands-posten.dk": "Jyllands Posten",
    "tv2.dk": "TV2",
    "www.b.dk": "Berlingske"
}

views.py:

SOURCES = '''information.dk dr.dk jyllands-posten.dk tv2.dk b.dk'''.split()

Tests

for parser in parsers:
    $ python parsers/test_parser.py foo.Bar
for parser in parsers:
    $ python parsers/test_parser.py foo.Bar foo.test_url