<commit_before># encoding: utf-8

from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase


class ComicData(ComicDataBase):
    name = 'Lunch (tu.no)'
    language = 'no'
    url = 'http://www.tu.no/lunch/'
    start_date = '2009-10-21'
    rights = 'Børge Lund'


class Crawler(CrawlerBase):
    history_capable_days = 20
    schedule = 'Mo,Tu,We,Th,Fr'
    time_zone = 'Europe/Oslo'

    # Without referer, the server returns a placeholder image
    headers = {'Referer': 'http://www.tu.no/lunch/'}

    def crawl(self, pub_date):
        url = 'http://www.tu.no/?module=TekComics&service=image&id=lunch&key=%s' % (
            pub_date.strftime('%Y-%m-%d'))
        return CrawlerImage(url)<commit_msg>Fix flake8 warning<commit_after># encoding: utf-8

from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase


class ComicData(ComicDataBase):
    name = 'Lunch (tu.no)'
    language = 'no'
    url = 'http://www.tu.no/lunch/'
    start_date = '2009-10-21'
    rights = 'Børge Lund'


class Crawler(CrawlerBase):
    history_capable_days = 20
    schedule = 'Mo,Tu,We,Th,Fr'
    time_zone = 'Europe/Oslo'

    # Without referer, the server returns a placeholder image
    headers = {'Referer': 'http://www.tu.no/lunch/'}

    def crawl(self, pub_date):
        url = (
            'http://www.tu.no/'
            '?module=TekComics&service=image&id=lunch&key=%s'
        ) % pub_date.strftime('%Y-%m-%d')
        return CrawlerImage(url)
{'fraction_non_alphanumeric': 0.14294913071474566, 'fraction_numerical': 0.014810045074050225, 'mean_word_length': 3.188679245283019, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6780495', 'n_tokens_mistral': 593, 'n_tokens_neox': 549, 'n_words': 108}