<commit_before>/**
 * Copyright (c) 2015 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

#include "Erzaehlmirnix.h"

#include <QDebug>
#include <QRegularExpression>
#include <QRegularExpressionMatch>

Erzaehlmirnix::Erzaehlmirnix(QObject *parent) :
    Comic(parent)
{
    m_info.id             = QString("erzaehlmirnix");
    m_info.name           = QString("Erzaehlmirnix");
    m_info.color          = QColor(188, 197, 192);
    m_info.authors        = QStringList("<NAME>");
    m_info.homepage       = QUrl("https://erzaehlmirnix.wordpress.com/");
    m_info.country        = QLocale::Germany;
    m_info.language       = QLocale::German;
    m_info.endDate        = QDate::currentDate();
    m_info.stripSourceUrl = QUrl("https://erzaehlmirnix.wordpress.com/");
}

QUrl Erzaehlmirnix::extractStripImageUrl(QByteArray data)
{
    QString html(data);
    QRegularExpression reg("<img[^>]*src=\"([^\"]*erzaehlmirnix.files.wordpress.com[^\"]*)\"");
    QRegularExpressionMatch match = reg.match(html);

    if (!match.hasMatch()) {
        return QUrl();
    }

    QString src = match.captured(1);
<commit_msg>fix Erzaehlmirnix comic<commit_after>/**
 * Copyright (c) 2015 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

#include "Erzaehlmirnix.h"

#include <QDebug>
#include <QRegularExpression>
#include <QRegularExpressionMatch>
#include <QRegularExpressionMatchIterator>

Erzaehlmirnix::Erzaehlmirnix(QObject *parent) :
    Comic(parent)
{
    m_info.id             = QString("erzaehlmirnix");
    m_info.name           = QString("Erzaehlmirnix");
    m_info.color          = QColor(188, 197, 192);
    m_info.authors        = QStringList("<NAME>");
    m_info.homepage       = QUrl("https://erzaehlmirnix.wordpress.com/");
    m_info.country        = QLocale::Germany;
    m_info.language       = QLocale::German;
    m_info.endDate        = QDate::currentDate();
    m_info.stripSourceUrl = QUrl("https://erzaehlmirnix.wordpress.com/");
}

QUrl Erzaehlmirnix::extractStripImageUrl(QByteArray data)
{
    QString html(data);
    QRegularExpression reg("<img[^>]*src=\"([^\"]*erzaehlmirnix.files.wordpress.com[^\"]*)\"");
    QRegularExpressionMatchIterator matchIterator = reg.globalMatch(html);

    if (!matchIterator.hasNext())
        return QUrl();

    matchIterator.next();

    if (!matchIterator.hasNext())
        return QUrl();

    QRegularExpressionMatch match = matchIterator.next();

    QString src = match.captured(1);

{'fraction_non_alphanumeric': 0.14334600760456273, 'fraction_numerical': 0.01064638783269962, 'mean_word_length': 3.4897610921501707, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '6247348', 'n_tokens_mistral': 936, 'n_tokens_neox': 865, 'n_words': 160}