diff --git a/web.py b/web.py index 63ef980..feed702 100755 --- a/web.py +++ b/web.py @@ -193,7 +193,7 @@ def cc_connect(): @app.route('/internal/ccc_a', methods=['POST']) def ccc_a(): #step one of curiouscat connection: retreive details - r = requests.get("https://curiouscat.me/api/v2/profile?username={}".format(request.form['cc'])) + r = requests.get("https://curiouscat.me/api/v2/profile?username={}&count=1".format(request.form['cc'])) j = r.json() if 'error' in j: return redirect('/cc_connect?invalid') @@ -201,7 +201,7 @@ def ccc_a(): #step one of curiouscat connection: retreive details "cc":j['userData']['username'], "ccavi":j['userData']['avatar'], "ccid":j['userData']['id'], - "latest_post":j['posts'][0]['timestamp'] #only post new answers from this point onwards, rather than posting all the old ones + "latest_post":j['posts'][0]['timestamp'] if len(j['posts']) != 0 else 0 #only post new answers from this point onwards, rather than posting all the old ones } return redirect('/cc_connect/confirm')