Added profile stats to API

This commit is contained in:
Yusur 2019-11-05 22:15:16 +01:00
parent c57088c6c3
commit ef8d5343e9
2 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.7.1-dev
* Adding `messages_count`, `followers_count` and `following_count` to `profile_info` API endpoint (forgot to release).
## 0.7.0 ## 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`. * 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`.

View file

@ -129,7 +129,10 @@ def profile_info(self, userid):
"generation": profile.year, "generation": profile.year,
"instagram": profile.instagram, "instagram": profile.instagram,
"facebook": profile.facebook, "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())
} }
} }