From edc643d3dab8803fb6c2de10389a130d26d092d1 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 24 Jan 2017 11:43:09 +0100 Subject: [PATCH] comp fetarticle --- compiler/compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/compiler.py b/compiler/compiler.py index 69a6f91..4543cfa 100644 --- a/compiler/compiler.py +++ b/compiler/compiler.py @@ -89,9 +89,11 @@ def fetarticle(url, raw): if h is not None: d["section"]= "FET - " + h.text.strip() + h=sp.find("span", {"itemprop": "datePublished"}) if h is not None: - d["published"]=parse(h.encode_contents().strip()) + h1= re.sub(r'[^\d]*(\d+)\.(\d+)\.(\d+)[^\d]*', r'\3/\2/\1',unicode(h.text).strip()) + d["published"]=parse(h1.strip()) h=sp.find("meta", {"property": "og:image"}) if h is not None: