From 4044e33c6c58eebe94d9ed843745cfb5b0c02089 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 18 Feb 2018 16:39:39 +0100 Subject: [PATCH] remove closings of Direkte Aktion and GG/BO feeds --- CMakeLists.txt | 2 +- src/parse.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c6b58f..1543cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7) include(GNUInstallDirs) project (mastorss - VERSION 0.2.4 + VERSION 0.2.5 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index a2ee52d..0af7b0c 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -96,15 +96,21 @@ std::vector parse_website(const string &profile, const string &xml) std::regex recdata2("\\]\\]>"); std::regex restrip("<[^>]*>"); std::regex reindyfuckup("\\/\\* Style Definitions \\*\\/[.[:space:]]*$"); + // Direkte Action closing + std::regex redaclosing("Der Beitrag .* erschien zuerst auf Direkte Aktion."); + // GG/BO closing + std::regex reggboclosing("Die von den einzelnen AutorInnen .* jeweiligen Text kenntlich gemacht ist."); str = std::regex_replace(str, relt, "<"); str = std::regex_replace(str, regt, ">"); - str = std::regex_replace(str, std::regex("[\\n\\r]+"), "\n"); // remove excess newlines str = std::regex_replace(str, reparagraph, "\n\n"); str = std::regex_replace(str, recdata1, ""); str = std::regex_replace(str, recdata2, ""); str = std::regex_replace(str, restrip, ""); str = std::regex_replace(str, reindyfuckup, ""); + str = std::regex_replace(str, redaclosing, ""); + str = std::regex_replace(str, reggboclosing, ""); + str = std::regex_replace(str, std::regex("[\\n\\r]{3,}"), "\n"); // remove excess newlines for (const string &hashtag : watchwords) {