republique

helper scripts for www.republique-numerique.fr
git clone https://a3nm.net/git/republique/
Log | Files | Refs | README

commit 4fd299d083c8e23c504375bcda48256ec2feec05
parent 3920f022ff8117cfb893a7a676c99d3f093a86fc
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed, 14 Oct 2015 22:55:30 +0100

use title

Diffstat:
stdump.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/stdump.py b/stdump.py @@ -42,7 +42,10 @@ def parse(j, i, key, idF): votes_nok = 0 votes_total = 0 url = j['_links']['show'] - body = html.unescape(j['body']).split('\n')[0] + try: + body = html.unescape(j['title']).split('\n')[0] + except KeyError: + body = html.unescape(j['body']).split('\n')[0] yield (nid, author, votes_ok, votes_mitige, votes_nok, votes_total, url, body) if 'arguments' in j.keys():