From ef8d5343e9807e2806e66fcee54e929e739d7335 Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Tue, 5 Nov 2019 22:15:16 +0100 Subject: [PATCH] Added profile stats to API --- CHANGELOG.md | 4 ++++ app/api.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2d98a1..c022145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.7.1-dev + +* Adding `messages_count`, `followers_count` and `following_count` to `profile_info` API endpoint (forgot to release). + ## 0.7.0 * Biggest change: unpacking modules. The single `app.py` file has become an `app` package, with submodules `models.py`, `utils.py`, `filters.py`, `website.py` and `ajax.py`. There is also a new module `api.py`. diff --git a/app/api.py b/app/api.py index 828ba65..05bbd94 100644 --- a/app/api.py +++ b/app/api.py @@ -129,7 +129,10 @@ def profile_info(self, userid): "generation": profile.year, "instagram": profile.instagram, "facebook": profile.facebook, - "relationships": get_relationship_info(self, user) + "relationships": get_relationship_info(self, user), + "messages_count": len(user.messages), + "followers_count": len(user.followers()), + "following_count": len(user.following()) } }