rewrite extractors to use text-module

This commit is contained in:
Mike Fährmann
2015-10-03 15:43:02 +02:00
parent 2962bf36f6
commit 42b8e81a68
11 changed files with 66 additions and 98 deletions

View File

@@ -9,6 +9,7 @@
"""Base classes for extractors for different Futaba Channel boards"""
from .common import SequentialExtractor, Message
from .. import text
import re
class ChanExtractor(SequentialExtractor):
@@ -44,5 +45,4 @@ class ChanExtractor(SequentialExtractor):
"""Return thread title from first post"""
if "sub" in post:
return post["sub"]
com = re.sub("<[^>]+?>", "", post["com"])
return " ".join(com.split())[:50]
return text.remove_html(post["com"])[:50]