republique

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

commit f496937a97c0be04c185996c9c3588116326c7e1
parent b0656ef67ae25ae9d5681820dadc9c9232131083
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 17 Oct 2015 02:42:50 +0200

adjust to minor change in API format

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

diff --git a/stdump.py b/stdump.py @@ -11,8 +11,11 @@ import sys def getAuthor(j): pref = "https://www.republique-numerique.fr/profile/user/" + pref2 = "https://www.republique-numerique.fr/profile/" s = j['_links']['profile'] - assert(s.startswith(pref)) + if not (s.startswith(pref)): + assert (s.startswith(pref2)) + return s[len(pref2):] return s[len(pref):] def opinionId(j, i=None):